如何在android工作室中水平线性布局中添加高分辨率图像
问题描述:
我想在线性布局中水平添加两个图像,但它们的分辨率很高。如何在android工作室中水平线性布局中添加高分辨率图像
<ImageView
android:id="@+id/img1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>;
<ImageView
android:id="@+id/img2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>;
答
使用Android:定位属性附加伤害
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
答
试试这个
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="top">
<ImageView
android:id="@+id/img1"
android:src="@drawable/img1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ImageView
android:id="@+id/img2"
android:src="@drawable/img2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout >
不要忘了添加图像IMG1,IMG2在绘制文件夹
添加机器人:方向= “横向”到线性布局然后更改ImageView宽度0dp并将layoutweight =“1”添加到两者,根据需要更改值。使用android:src =“@ drawable/img1”从drawable添加图像 – ALi0007