1。关于组件居中

 ① android:layout_gravity="center"
控件在包含该控件的父控件中的位置。同样,当我们在Button按钮控件中设置android:layout_gravity="left"属性时,表示该Button按钮将位于界面的左部。
②android:scaleType="center"截取图片中间显示 
③   android:scaleType="centerInside"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" > <TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="个人中心"
android:gravity="center"
android:textSize="30px"
android:background="#44cef6"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:gravity="center"
>
<ImageView
android:id="@+id/img_me"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_launcher" />
</LinearLayout> <LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5"
>
<GridView
android:id="@+id/person_grid_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numColumns="3"
android:stretchMode="columnWidth">
</GridView> </LinearLayout>
</LinearLayout>
 

最新文章

  1. leetcode 82. Remove Duplicates from Sorted List II
  2. iOS 两个App之间调起通信
  3. VBScript [ 译 ]
  4. AD组策略添加本地账号、设置允许ping回显
  5. 1085: [SCOI2005]骑士精神
  6. C++ (P70—P96)
  7. ashx文件结合ajax使用(返回json数据)
  8. 2015年10个最佳Web开发JavaScript库
  9. 3DTouch
  10. Java学习----方法的覆盖
  11. ajax get/post
  12. 201521123016 《Java程序设计》第8周学习总结
  13. 邓_ ThinkPhp框架
  14. [HAOI 2010]软件安装
  15. PHP二维数组去重(指定键名)
  16. TCPDF打印从入门到精通
  17. STL进阶--成员函数 vs 算法
  18. Python笔记:用for循环删除列表中的元素
  19. 1200 同余方程 2012年NOIP全国联赛提高组
  20. 通用性好的win2003序列号: (推荐先用这个里面的)

热门文章

  1. 你一无所知的CSS
  2. 基于FPGA的飞机的小游戏
  3. 点击弹出li所在的序列号
  4. html 元素分类
  5. maven 生成可执行的jar文件
  6. jquery 使用方法
  7. php 不用四舍五入的方式截取小数点后两位
  8. Javascript随记
  9. ResourceManager里面Trackingui需要手动该ip
  10. MapReduce实现手机上网日志分析(分区)