我试图给一个图像视图边框,使用布局来包裹它并将边框设置为该特定布局的背景。然而,图像视图看起来很小,并且在框架背景的左上角。带边框的图像,显示不正确
这里是我的代码:
<RelativeLayout
android:id="@+id/Relative1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="25dp"
android:layout_marginTop="40dp"
android:background="@drawable/pic_frame_big_01" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
使图像适合相对布局并占有它我怎么能修改此代码。
编辑更改了ImageView的代码,现在图像居中,但它看起来像是一个以父级为中心的非常小的图像。
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
将一些图像设置为'src'到图像视图。现在它是空的! –