我有以下在我的main.xml的图像标记没有填满设备的宽度?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:screenOrientation="portrait">
<ImageView
android:id="@+id/ImageView01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:src="@drawable/marker">
</ImageView>
</LinearLayout>发布于 2010-11-21 14:03:29
您将ImageView的高度设置为wrap_content。这意味着ImageView将只占用您选择的图像所需的空间。如果您希望它占据整个屏幕,只需将您的layout_height更改为fill_parent即可。
您还需要选择一个带有android:scaleType=""的ImageView scaleType。
发布于 2010-11-21 13:59:31
试一试
android:adjustViewBounds="true"或者结账
image_view_1.xml在安卓APIDemos中。
这应该是有帮助的。
https://stackoverflow.com/questions/4236642
复制相似问题