2017年3月20日 星期一

UI Design

 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


      dpDensity-independent pixel。 1 DP相當於一個像素的160 dpi的屏幕上。

   spScale-independent pixel。

   ptPoint

   pxPixel。像素。

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解析度適配

沒有留言:

張貼留言