ImageButton中使用透明背景图片
2017-02-28 11:24
363 查看
首先,我们需要一张背景透明的图片,一般是美工制作,网上也可以搜到这样的图片,想自己制作的可以用PS,新建一个,并且将背景内容设为透明
使用透明背景图片
在ImageView中使用透明背景图片
在ImageView中,直接将src设为我们需要的图片即可,不要在background中设置,如果图片大小与外框大小差很多,会拉伸或者缩小,导致图片模糊或者看不到
在ImageButton中使用透明背景图片
同样的,不要在background中设置图片,在src中设置图片,然后会发现图片并没有透明,我们还需要把ImageButton的background属性设为”#00000000”
使用透明背景图片
在ImageView中使用透明背景图片
在ImageView中,直接将src设为我们需要的图片即可,不要在background中设置,如果图片大小与外框大小差很多,会拉伸或者缩小,导致图片模糊或者看不到
在ImageButton中使用透明背景图片
同样的,不要在background中设置图片,在src中设置图片,然后会发现图片并没有透明,我们还需要把ImageButton的background属性设为”#00000000”
android:src="@drawable/login_image_button" android:background="#00000000"
相关文章推荐
- android imageButton 使用透明图片
- android中使用selector动态改变imageView或ImageViewButton的背景
- android 界面 按button或者imagebutton改变图片或者背景的效果
- android <ImageButton>设置背景图片无法显示
- andoid点击按钮(ImageButton)时改变按钮的背景图片 SelectorDemo
- 使用GIMP实现图片的背景透明
- 使用滤镜解决IE6下PNG图片背景不透明的BUG
- 使用 GIMP 将图片背景设为透明
- 使用DD_belatedPNG让IE6支持PNG透明图片 及IE6下背景图闪烁问题的解决方法
- Button的背景使用selector图片无法显示的问题
- ImageButton设置背景透明后,点击显示button按下效果
- android中使用selector动态改变imageView或ImageViewButton的背景
- android中使用selector动态改变imageView或ImageViewButton的背景
- Use Custom Background Image for Application-为自己的Windows Phone程序使用自定义背景图片
- delphi从imagelist中获取透明背景图片的方法
- android中使用selector动态改变imageView或ImageViewButton的背景
- asp:Button 使用背景图片
- GTK 背景透明button (GtkImage + EventBox)
- 使用mac OS自带预览功能制作透明背景的PNG图片
- UIButton 背景图片延长 笔记 stretchableImageWithLeftCapWidth的使用