protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /*设置状态栏颜色*/ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Window window = getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setStatusBarColor(getResources().getColor(R.color.yellow)); } setContentView(R.layout.activity_main); }
自定义状态栏颜色 安卓
最新推荐文章于 2024-04-28 01:43:09 发布