Android 在栅格布局中并排拟合和缩放两个图像
我有两张图片--左边是播放按钮,右边是音箱。我正在尝试缩放这些图像的高度和宽度,使其看起来像这样 尽管我的代码产生了这样的结果: 基本上,这些文件都相当大,大小也不正确,但我不知道为什么boombox图像会被切断。我希望整个伸缩臂箱都能安装,然后播放按钮根据伸缩臂箱的高度调整其高度 这是我的布局代码,但我认为我需要进行重大更改:Android 在栅格布局中并排拟合和缩放两个图像,android,image,layout,grid,scale,Android,Image,Layout,Grid,Scale,我有两张图片--左边是播放按钮,右边是音箱。我正在尝试缩放这些图像的高度和宽度,使其看起来像这样 尽管我的代码产生了这样的结果: 基本上,这些文件都相当大,大小也不正确,但我不知道为什么boombox图像会被切断。我希望整个伸缩臂箱都能安装,然后播放按钮根据伸缩臂箱的高度调整其高度 这是我的布局代码,但我认为我需要进行重大更改: <GridLayout android:layout_width="fill_parent" android:layout_height="f
<GridLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:stretchMode="columnWidth"
android:numColumns="2"
android:scaleType="fitXY"
>
<ImageView
android:id="@+id/play_stop_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_column="0"
android:src="@drawable/play_button_final"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:layout_column="1"
android:scaleType="fitXY"
android:src="@drawable/boombox"
android:id="@+id/boombox"
/>
</GridLayout>
试试这个
<GridLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:stretchMode="columnWidth"
android:numColumns="2"
android:scaleType="fitXY"
>
<ImageView
android:id="@+id/play_stop_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_column="0"
android:src="@drawable/play_button_final"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:layout_column="1"
android:scaleType="fitXY"
android:src="@drawable/boombox"
android:id="@+id/boombox"
/>
</GridLayout>
不,运气不好。还是一样吗