<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:background="@android:color/white" >    <ImageButton        android:id="@+id/btnSch"        android:layout_width="fill_parent"        android:layout_height="fill_parent"        android:src="@drawable/next" /></LinearLayout>

设置上面的代码后,ImageButton四周会有一个边框,感觉没有fill到父容器。

这是因为ImageButton有默认的背景色,如果想让ImageButton彻底fill到父容器,设置android:background="@null"后,即可达到完全填满的效果

PS.图片缩放效果可以通过android:scaleType设置。

转自:http://www.mikebai.com/html/2012-04/941.html

更多相关文章

  1. android 仿微信群组头像效果
  2. android中TextView的文字实现动态效果,走马灯效果,闪烁效果
  3. android shape渐近线效果

随机推荐

  1. Android开发之Android Context,上下文(Act
  2. 安卓消息处理机制
  3. 向Android操作栏中添加操作项和浮动菜单
  4. W/System.err:at java.net.PlainDatagramS
  5. Android Activity 完全解析(下)
  6. Android新手入门2016(11)--非阻塞对话框Ale
  7. 如何把项目从github上导入到android stud
  8. android在onCreate()方法中获取View的宽
  9. 【Android 进阶】ButterKnife-黄油刀
  10. 对于Android的文件结构介绍