android實現簡單的切換StatusBar和ActionBar的顏色
只需要在需要切換的Activity中執行如下代碼:
ActionBar ab = getSupportActionBar();
if(ab != null)
{
ab.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.TinyBlue)));
getWindow().setStatusBarColor(getResources().getColor(R.color.TinyBlue));
}