我的LinearLayout包含两个TextViews (TextView1和TextView2)和一个ImageView。现在我希望LinearLayout始终有一个固定的高度,即ThextView1的高度,以便ImageView始终将其fill_parent图像的大小调整为TextView1的高度。
_____________________________________
|TextView1------------------ ImageView|
|TextView1 --- TextView2 --- ImageView|
|TextView1 ----------------- ImageView|很难解释..。ImageView应该始终保持TextView1的高度并调整其图像的大小(同时保持原始的宽高比)。
这是否可以仅使用layout-xml来实现,或者我是否需要以编程方式来实现?
我希望你能帮助我:)
发布于 2013-03-25 03:39:14
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
... />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
... />
</LinearLayout>我还没有测试过这个。这就是你说的吗?
https://stackoverflow.com/questions/15602947
复制相似问题