控件布局的方法

linearLayout

android:layout_width="match_parent"
android:layout_height="match_parent"
匹配父控件的宽高 wrap_parent
android:orientation="vertical"垂直方向布局

内边框 边距

像素 通常被认为是数字图像的最小单个组件。像素是一个单位;像素是构成数码影像的基本单元,通常以像素每英寸PPI(pixels per inch)为单位来表示影像分辨率的大小。
视网膜屏 Retina display 将960×640的像素压缩到一个3.5英寸的显示屏内。也就是说,该屏幕的像素密度达到326像素/英寸(ppi pixels per inch),称之为“视网膜屏幕”.
3.5英寸的手机(对角线为3.5英寸) 分辨率960×640 计算ppi

ppi=9602+64023.5
结果为329.65
dpi dots per inch 每英寸的点数
dp device independent pixels
定义在dpi为160的屏幕上 1dp = 1px
px=dpdpi160
sp scled pixels 通常用来指定字体的大小

layout_margin 外边距 padding 内边距

更多相关文章

  1. 利用Hierarchy Viewer优化布局
  2. Android(安卓)Material Design控件学习(二)——NavigationView的学
  3. android获取自定义控件位置坐标,屏幕尺寸,标题栏,状态栏高度
  4. Android(安卓)ProgressBar圆形进度条颜色设置
  5. android 自定义控件继承TextView
  6. android 自定义LabelView实现各类小标签,重要功能已标注
  7. Animations使用(一)
  8. Android使用ValueAnimator开发仿余额宝数值增加控件
  9. 今日头条屏幕适配_工具类

随机推荐

  1. Android(安卓)RecyclerView+StaggerLayou
  2. onRetainNonConfigurationInstance和getL
  3. Android(安卓)Q中外部存储盘路径正则表达
  4. Android(安卓)快速选择联系人
  5. android中的Inflater
  6. Android(安卓)activity的生命周期
  7. android pdf 阅读器开发, pdf demo, pdf
  8. android EditText+ListView的组合(类似于A
  9. Android全屏设置的两种方式
  10. android 中调用接口发送短信