Layout displayed differently on different devices at the same resolution screen

*爱你&永不变心* 提交于 2019-12-05 04:06:07

The phones do have the same resolution, however, the window height is different because LG G2 has navigation keys on the screen.

The problem is not in layout or density, but in the different heights available, due to the presence of the button bar. As the image set as background of the View will expand, distorting itself, I suggest you to put it as src of the ImageView and set the scaleType to fitCenter, this way the image will fit the screen maintaining its proportions:

<ImageView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scaleType="fitCenter"
    android:src="@drawable/background01" />
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!