我有两张图片--左边有一个播放按钮,右边有一个音箱。我正在尝试缩放这些图像的高度和宽度,如下所示

虽然我的代码产生了这样的结果:

从本质上讲,这些文件很大,而且大小不正确,但我不知道为什么boombox图像会被切断。我想让整个音箱适应,然后播放按钮,以调整其高度根据音箱的高度。
这是我的布局代码,尽管我认为我需要做一些大的修改:
<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>发布于 2015-06-25 02:59:18
尝尝这个,
<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>https://stackoverflow.com/questions/31034185
复制相似问题