1. 程式人生 > >讀小米文件筆記

讀小米文件筆記

一、全面屏及虛擬鍵適配
方法1:
<application android:resizeableActivity="true" ></application>
方法2:

 <application>
    <meta-data android:name="android.max_aspect" android:value="2.2" />
    </application>

二、虛擬導航鍵(Navigation bar)優化
建議1:如果頁面含有複雜背景/紋理,建議設定為透明,如桌面和通話介面。
建議2:含「底部Tab」的頁面,建議將虛擬鍵設定為「底部Tab」的顏色,如 MIUI 的相機和小米商城
建議3:不含「底部Tab」的頁面,建議使用背景顏色,如多看閱讀

/**
 * Sets the color of the navigation bar to {@param color}.
 *
 * For this to take effect,
 * the window must be drawing the system bar backgrounds with
 * {@link android.view.WindowManager.LayoutParams#FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS} and
 * {@link android.view.WindowManager.LayoutParams#FLAG_TRANSLUCENT_NAVIGATION} must not be set.
 *
 * If {@param color} is not opaque, consider setting
 * {@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and
 * {@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION}.
 * <p>
 * The transitionName for the view background will be "android:navigation:background".
 * </p>
 */
public abstract void setNavigationBarColor(@ColorInt int color);​