您的位置:首页 > 其它

设置状态通知栏的颜色

2017-03-31 09:46 197 查看
/**
* 初始化通知栏样式
*
* @param isNavigationBarGray 是否灰色样式            输入true就为color_333333,,,,,,,,,输入为false就为color_005799
*/
@Override
public void initNavigationBarStyle(boolean isNavigationBarGray) {
// Only set the tint if the device is running KitKat or above
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setStatusBarTintColor(getResources().getColor(
isNavigationBarGray ? R.color.color_333333 : R.color.color_005799));
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: