我正在制作布局并使用 layout_weight 和 weight_sum。我正在将线性布局的方向设置为水平,因此我可以将 imageview 的宽度设置为屏幕的 1/3。但我不知道如何将 imageview 的高度设置为屏幕的 1/3。
请帮助我从布局 xml 将图像视图高度设置为屏幕的 1/3。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="1">
<ImageView
android:id="@+id/savedImageView"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".33"
android:background="@drawable/background" />
</LinearLayout>
提前致谢