我有一个带有多个图像视图的水平线性布局。有没有办法自动调整这些视图的大小,以便所有这些视图都适合屏幕? 这是代码:
<LinearLayout
android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/cinnamon"/>
<ImageView
android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@+id/cinnamon"/>
<ImageView
android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ham"/>
最好的问候
答案 0 :(得分:0)
使用所有图像视图,确保将布局设置为最符合您需求的布局。试试“fill_parent”。宽度和高度。向我们提供一些代码以及您希望向用户显示的布局的更好描述,我们可以为您提供更好的示例。如果这有帮助,请告诉我们。
<强>解决方案强>
为每个图像视图将layout_weight
设置为1.