【发布时间】:2019-04-02 03:49:56
【问题描述】:
我想要设计像 canva 应用程序这样的启动画面。喜欢
(此截图取自 android API 版本 26)。
我在 Activity.java 中试过这段代码:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
}
}
而XML代码是:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/gradient_splash_screen">
<FrameLayout
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_centerInParent="true"
android:background="@drawable/icon_splash_screen">
<TextView
android:id="@+id/tv_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/app_name"
android:textColor="#678ee4"
android:textSize="28sp" />
</FrameLayout>
</RelativeLayout>
我最近提到了this question,但它不足以将导航栏图标颜色更改为白色。
【问题讨论】:
标签: android