安卓工作室 : Image Buttons Not Showing Full Image

标签 android android-layout imagebutton

图像按钮仅显示一小块放大的图像。我不希望图像是全尺寸的。我想看全图,只是小一点。我该怎么做呢?我正在尝试制作数字市场类型的应用程序,例如 this .

最佳答案

试试这个。它肯定会起作用。

<ImageButton android:id="@+id/img" android:src="@drawable/img" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" android:maxWidth="100dp" android:maxHeight="100dp" android:scaleType="fitCenter" android:layout_alignParentLeft="true" android:contentDescription="@string/img"/>

关于安卓工作室 : Image Buttons Not Showing Full Image,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41268854/

相关文章:

java - 没有引用或无法找到引用导致的不确定错误 - java.lang.IndexOutOfBoundsException

javascript - 在集成 React native 和 android 应用程序时更改 MainActivity 条目

android - 在 SherlockFragment 中切换布局 XML

android - 微调器打破全屏/沉浸式标志

android - 从 sherlock fragment 添加进度对话框到操作栏 sherlock

java - Android 应用程序中的 ArrayIndexOutOfBoundsException

xaml - Xamarin ImageButton 单击后不可见

android - 使用其中的 ImageButton 捕获 LinearLayout onClick 事件

android - 如何获得x,y坐标

android - 任何人都可以将录音机的代码作为Android手机上的应用程序提供吗?