“Ubah status bilah teks warna android secara terprogram” Kode Jawaban

Ubah status bilah warna android secara terprogram

 public void statuscolor(){
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Window window = getWindow();
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(Color.parseColor(getPreferences().getString(Constant.SECONDARY_COLOR, Constant.SECONDARY_COLOR)));
        }
    }
KushalCodes

StatusBar Teks warna android

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);//  set status text dark

getWindow().setStatusBarColor(ContextCompat.getColor(MainActivity.this,R.color.colorPrimaryDark));// set status background white
Energetic Emu

Ubah status bilah teks warna android secara terprogram

WindowInsetsControllerCompat(<window>, <view>).isAppearanceLightStatusBars = Boolean
Window window = Activity.getWindow();
View view = window.getDecorView();

// You need androidx.core for this
Stupid Squirrel

Jawaban yang mirip dengan “Ubah status bilah teks warna android secara terprogram”

Pertanyaan yang mirip dengan “Ubah status bilah teks warna android secara terprogram”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya