在我RelativeLayout
,我有一个海景(在drawable-xxhdpi
1870px
X 756px
),我中心所有设备的大背景图片:ImageView的固定位置
<ImageView
android:src="@drawable/bg_image"
android:scaleType = "centerCrop"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ImageView>
在它的上面,我想放置另一个船的图像(500px
x 300px
也在drawable-xxhdpi
),水平居中,但应该是230px
远离屏幕的顶部在地平线上。
<ImageView
android:src="@drawable/another_image"
android:layout_centerHorizontal="true"
android:layout_marginTop="230px"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</ImageView>
我没有得到正确的结果和Android抱怨使用px
为单位的利润率最高。
结果:设备1(在地平线上调整)
较小的器件2(未在地平线上调整):
任何建议?
什么是你所得到的结果,请注明 – Aakash
@Aakash我增加了更多的解释,谢谢 –
需要修复的图像大小为实现这一 – Aakash