android - 删除 imagebutton 中的空格
问题描述
在我的图像按钮中,源图像周围有很多空白区域。是否可以删除此空间,以便图像按钮仅围绕源图像本身。
<ImageButton
android:id="@+id/story_1"
android:src="@drawable/my_story"
style="?android:attr/borderlessButtonStyle"
android:layout_width="55dp"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:contentDescription="Add my story" />
解决方案
试试这个
<ImageButton
android:id="@+id/story_1"
android:src="@drawable/my_story"
style="?android:attr/borderlessButtonStyle"
android:background="@null"
android:layout_width="55dp"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:contentDescription="Add my story" />
推荐阅读
- java - 发送列表
在休息 api 请求但接收错误 - powershell - 使用循环将多个文件的内容保存在别处
- python - 部署烧瓶应用程序时如何将argparse与gunicorn一起使用?
- python - 在并行目录中导入 python 模块
- c# - 将字符串“7.30”转换为时间格式 hh:mm
- python - 尝试使用 Google 广告 API 时出现客户 ID 错误。输入客户 ID 需要什么?为什么我会收到此错误消息?
- java - 结果中的记录数导致 -> 对象引用未设置为对象的实例 - Azure Cosmos Db
- php - 设置当前页面处于活动状态并从 ID 数据库中获取页面数据
- hana - 尝试在 SAP HANA 上使用 UNION ALL 语法时出错
- typescript - BackboneJS 路由器不渲染视图