UI Design
UI Design:使用者介面設計。
UI screen components
- Main Action Bar(主操作欄)
- View Control(圖片控制)
- Content Area(內容區)
- Split Action Bar
Understanding Screen Components
View and ViewGroups
View只是螢幕上的小元件。
ViewGroups 很多螢幕上的小元件組成。
Types of layout
Linear Layout(線性布局)
Absolute Layout(絕對布局)
Table Layout(表格布局)
Frame Layout(框架布局)
Relative Layout(相對布局)
views and ViewGroups 的其他屬性
layout_width:指定View 或 ViewGroups的寬度。
layout_height:指定View 或 ViewGroups的高度。
layout_marginTop :指定View 或 ViewGroups的上邊沿的間隔。
layout_marginBottom :指定View 或 ViewGroups的底邊沿的間隔。
layout_marginLeft:指定View 或 ViewGroups的左邊沿的間隔。
layout_marginRight :指定View 或 ViewGroups的右邊沿的間隔。
layout_gravity:項目在畫面上的位置。比如一個button 在linearlayout裡,你想把該button放在linearlayout裡靠左、靠右等位置就可以通過該屬性設置。
layout_weight:指定View 或 ViewGroups的大小以百分比顯示。
Units of Measurement
dp:Density-independent pixel。 1 DP相當於一個像素的160 dpi的屏幕上。
sp:Scale-independent pixel。
pt:Point。
px:Pixel。像素。
Screen Densities
Low density (ldpi):120 dpi
Medium density (mdpi):160 dpi
High density (hdpi):240 dpi
Extra High density (xhdpi):360 dpi
Optimizing layouts(優化layout)
避免不必要的嵌套。
避免使用太多圖片。
避免深層嵌套。
參考文獻
Android - UI Design
Android UI設計教程
[Android] layout_weight的妙用-讓View的大小以百分比率顯示(proportionate size)
Android 利用 layout_weight 屬性來設定物件的版面所佔比例 (權重) (平均分配)
Android 的 pixel 與 dp
[Android]長度單位詳解(dp、sp、px、in、pt、mm)
Android解析度適配
https://read01.com/AJBGDM.html
Android最佳實踐之性能 – 提升Layout性能
http://www.cjyweb.cn/2016/04/11/android%E6%9C%80%E4%BD%B3%E5%AF%A6%E8%B8%90%E4%B9%8B%E6%80%A7%E8%83%BD-%E6%8F%90%E5%8D%87layout%E6%80%A7%E8%83%BD/
Android最佳實踐之性能 – 提升Layout性能
http://www.cjyweb.cn/2016/04/11/android%E6%9C%80%E4%BD%B3%E5%AF%A6%E8%B8%90%E4%B9%8B%E6%80%A7%E8%83%BD-%E6%8F%90%E5%8D%87layout%E6%80%A7%E8%83%BD/
沒有留言:
張貼留言