“Warna bilah status android” 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

status batang warna android Kotlin

Window window = activity.getWindow();

// clear FLAG_TRANSLUCENT_STATUS flag:
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);

// add FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag to the window
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);

// finally change the color
window.setStatusBarColor(ContextCompat.getColor(activity,R.color.my_statusbar_color));
Worried Wren

StatusBar Teks warna android

getWindow().setStatusBarColor(ContextCompat.getColor(BookReaderActivity.this, R.color.black));
View decorView = getWindow().getDecorView(); //set status background black 
decorView.setSystemUiVisibility(decorView.getSystemUiVisibility() & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); //set status text  light
Energetic Emu

Warna bilah status android

 <!-- in themes -->
<item name="android:statusBarColor">@color/color</item>
Calrissian

StatusBar Teks warna android

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);//  set status text dark
getWindow().setStatusBarColor(ContextCompat.getColor(BookReaderActivity.this,R.color.white));// set status background white
Energetic Emu

Jawaban yang mirip dengan “Warna bilah status android”

Pertanyaan yang mirip dengan “Warna bilah status android”

Lebih banyak jawaban terkait untuk “Warna bilah status android” di HTML

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya