“Ubah status bilah 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

cara mengubah warna statusbar untuk aktivitas di studio android

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

Warna bilah status android

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

cara mengubah warna aksi aksi di android secara terprogram

getSherlockActivity().getSupportActionBar().setBackgroundDrawable(new ColorDrawable(0xff00ACED));
mActionBar.setBackgroundDrawable(new ColorDrawable(0xff00DDED));
mActionBar.setDisplayShowTitleEnabled(false);
mActionBar.setDisplayShowTitleEnabled(true);
Inexpensive Impala

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 warna android secara terprogram”

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

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya