我在framelayout下使用imageview。我在 ImageView 中应用了背景图像,但图像无法完全覆盖屏幕。它出现在中心。我想完全覆盖屏幕...
我怎样才能实现它? 提前感谢:-)
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.muhammad.maqalatlayout.jild_copy"
android:background="@color/Green">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@mipmap/brown_border1"
android:layout_margin="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="0dp"
android:layout_gravity="top|left|bottom|center_vertical|right"
android:visibility="visible"
android:adjustViewBounds="false"
android:scaleType="fitStart"/>
最佳答案
我相信您的体重秤无法正常工作,因为您正在设置 android:background
属性。试试这个:
<ImageView
...
android:src="@mipmap/brown_border1"
... />
此外,最好将图像放在 /drawable/
文件夹中。
关于java - 图像在框架布局中未正确显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38785573/