【发布时间】:2015-09-01 14:37:48
【问题描述】:
我有一个布局,其中线性布局包含 imageview 作为其直接子级。我想调整这个 imageview 的宽度,使其水平跨越以匹配父级的大小,父级的大小将占据整个屏幕的宽度。
我该怎么做?这是我到目前为止所做的:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/linearLayout"
>
<ImageView
android:layout_width="fill_parent"
android:layout_height="100dp"
android:layout_margin="0dp"
android:src="@drawable/policemen_salute"
android:id="@+id/banner"
/>
</LinearLayout>
</RelativeLayout>
看起来像这样
谢谢!
【问题讨论】:
-
好的,有什么问题?
-
它不会垂直拉伸。
-
我的意思是水平的。
-
向我们展示它的样子
-
好的,屏幕截图不好。