打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
android如何创建一个透明的ImageButton

我想创建一个透明的 ImageButton,把这些按钮都放在一个 SurfaceView 视图中,我在XML中这样设置的代码:

1
2
3
4
5
6
<ImageButton android:id="@+id/previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/media_skip_backward"
android:background="@drawable/transparent">
</ImageButton>


但是这样透明的 ImageButton 没有创建成功,如何实现呀?

解决方法 1:

给个具体的方法:

1
2
3
4
5
6
7
<ImageButton
       android:id="@+id/previous"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:background="@android:color/transparent"
       android:src="@drawable/media_skip_backward" >
   </ImageButton>

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Android Layout XML属性研究
android 根据button不同状态显示不同(背景)图片
Android下一行平均分布图片的布局
Android利用selector设置按钮不同状态下的背景图片
Android 中级教程之------Android MediaPlayer播放mp3的实...
Android开发:安卓版QQ登陆界面
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服