1 / 18

主讲:遆佳

第五讲 移动交通终端界面布局. 主讲:遆佳. 移动交通 课程目标. LinearLayout : 移动交通 线性布局 RelativeLayout : 移动交通 相对布局 AbsoluteLayout : 移动交通 绝对布局 TableLayout : 移动交通 表格布局. 移动交通 LinearLayout. 线性布局就是将物体 ( 容器内子组件 ) 按照直线进行摆放的一种方式. 移动交通 LinearLayout. 线性布局的 XML 属性 方向属性 android:orientation 属性 vertical 垂直方向

samara
Download Presentation

主讲:遆佳

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第五讲 移动交通终端界面布局 主讲:遆佳

  2. 移动交通课程目标 LinearLayout :移动交通线性布局 RelativeLayout :移动交通相对布局 AbsoluteLayout :移动交通绝对布局 TableLayout :移动交通表格布局

  3. 移动交通 LinearLayout 线性布局就是将物体(容器内子组件)按照直线进行摆放的一种方式

  4. 移动交通 LinearLayout 线性布局的XML属性 方向属性 android:orientation属性 vertical垂直方向 horizontal水平方向 宽度、高度属性 android:layout_width、android:layout_height属性 fill_parent宽度填满父控件 wrap_content按照子控件实际大小

  5. 移动交通 LinearLayout

  6. 移动交通 RelativeLayout 在该布局的所有组件中,后一个组件参照前一个组件的位置进行摆放

  7. 移动交通RelativeLayout 布局属性列表

  8. 移动交通 AbsoluteLayout 在该布局中每个组件在位置上没有任何关系,必须单独制定其位置信息

  9. 移动交通AbsoluteLayout布局属性列表

  10. 移动交通 FrameLayout 移动交通框架布局,该布局就像一个电影屏幕,该屏幕用来显示电影数据中的每一副画面,但同一时刻屏幕上只能显示一副画面 移动交通框架布局适合切换显示的场合(例如:标签控件,所有标签页都在屏幕的同一位置进行切换显示)

  11. 移动交通 FrameLayout示例

  12. 移动交通 FrameLayout布局属性列表

  13. 移动交通 TableLayout • 移动交通表格布局简洁直观,适合每一行的内容比较固定的界面,例如信息录入界面

  14. 移动交通 TableLayout布局属性列表

  15. 移动交通练习:

  16. 移动交通 Android中dimension单位 dip: device independent pixels(设备独立像素). 不同设备有不同的显示效果,这个和设备硬件有关,一般我们为了支持WVGA、HVGA和QVGA 推荐使用这个,不依赖像素。 px: pixels(像素). 不同设备显示效果相同,一般我们HVGA代表320x480像素,这个用的比较多。 pt: points,是一个标准的长度单位,1pt=1/72英寸,用于印刷业,非常简单易用; sp: scaled pixels(放大像素). 主要用于字体显示best for textsize。 由此,根据 google 的建议,TextView 的字号最好使用 sp 做单位,而且查看TextView的源码可知 Android 默认使用 sp 作为字号单位。 在 Android 中, 1pt 大概等于 2.22sp

  17. 移动交通margin&padding 移动交通边距(margin)和间隙(padding)属性的区别: 移动交通边距属性(margin)是用来设置一个元素所占空间的边缘到相邻元素之间的距离。 边距 移动交通间隙属性(padding)是用来设置元素内容到元素边界的距离。 间距

  18. Thanks!

More Related