我有这个ImageView
<ImageView
android:id="@+id/img_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/my_img_1" />
这是RelativeLayout
的孩子。我希望图片显示为page
/ parent
的左上角。但事实并非如此。父母的左侧和顶部以及子视图之间大约有20dp
margin
/ padding
。我如何得到我想要的东西?
答案 0 :(得分:1)
您期望的是应该发生什么。
听起来持有RelativeLayout
上有20dp填充 - 这会导致你描述的行为。
确保您已从父RelativeLayout
删除了填充!