android 介面設計

來源:互聯網
上載者:User

標籤:中文   菜單   抽屜   底部導覽列   win   regular   density   touch   使用   

wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics dm = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(dm); //將當前視窗的一些資訊放在DisplayMetrics類中
float density = dm.density; //密度 px = dp * density dp/px = density
int dpi = dm.densityDpi;
width = dm.widthPixels;
height = dm.heightPixels;

px = dp * density dp/px = density

焦點: android:focusable=“true” 不會改變android:focusableInTouchMode鍵盤
android:focusable=“false”,一定會使android:focusableInTouchMode=“false”
android:focusableInTouchMode=“false”,不會影響android:focusable針對觸屏
android:focusableInTouchMode=”true”,一定會是android:focusable=“true”

字型
英文字型使用Roboto,中文字型使用Noto。Noto有7種字重:Thin, Light、DemiLight、Regular、Medium、Bold 和 Black。
文字排版

常用字型大小:

12sp 小字提示
14sp(案頭端13sp) 本文/按鈕文字
16sp(案頭端15sp) 小標題
20sp Appbar文字
24sp 大標題
34sp/45sp/56sp/112sp 超大號文字
長篇幅本文,每行建議60字元(英文)左右。短文本,建議每行30字元(英文)左右。

布局

所有可操作元素最小點擊地區尺寸:48dp X 48dp。
柵格系統的最小單位是8dp,一切距離、尺寸都應該是8dp的整數倍。以下是一些常見的尺寸與距離:
頂部狀態列高度:24dp
Appbar最小高度:56dp
底部導覽列高度:48dp
懸浮按鈕尺寸:56x56dp/40x40dp
帳戶圖片尺寸:64x64dp/40x40dp
小表徵圖點擊地區:48x48dp
側邊抽屜到螢幕右邊的距離:56dp
卡片間距:8dp
分隔線上下留白:8dp
大多元素的留白距離:16dp
螢幕左靠右對齊基準:16dp
文字左側對齊基準:72dp

tab只用來展現不同類型的內容,不能當導覽功能表使用。tab至少2項,至多6項。
tab選中項的底線高度是2dp

android 介面設計

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.