android状态栏颜色修改 状态栏颜色的修改在4.4和5.x环境下分别有不同的方式,低于4.4以下是不能修改的. 5.x环境下 方式一,状态栏将显示为纯净的颜色,没有渐变效果 /** * 状态栏相关工具类 * */ public class StatusBarUtils { public static void setWindowStatusBarColor(Activity activity, int colorResId) { try { if (Build.VERSION.SDK
1.获取状态栏高度: decorView是window中的最顶层view,可以从window中获取到decorView,然后decorView有个getWindowVisibleDisplayFrame方法可以获取到程序显示的区域,包括标题栏,但不包括状态栏. 于是,我们就可以算出状态栏的高度了. Rect frame = new Rect(); getWindow().getDecorView().getWindowVisibleDisplayFrame(frame); int status
Android Unable to instantiate activity: Didn't find class on path After i spend a while on this problem, the solution that i found is a conflict between importing Properties > Android - appcompat_v7 and appcompat_v4 that was added in the libs folder.