写一些小方法 用着好着方便

   // 获取statusbar的高度 public int getStatusBarHeight(){    int result = 0;    int resourceId = getResources().getIdentifier("status_bar_height","dimen","android");    if (resourceId > 0){        result = getResources().getDimensionPixelOffset(resourceId);    }    return result;}

二、StatusBar设置透明色:

  1.在需要的style中,如下设置:

2.在需要的acivity.xml中设置

android:theme="@style/AppTheme"

如果整个app都是需要可以在application中设置。

3.需要的activity.xml中设置:

android:fitsSystemWindows="true"

更多相关文章

  1. Android开发之Shape和Selector、Layer-list的详解
  2. android studio适配器Adapter
  3. Android控件拖拽功能的实现
  4. ListView 样式自定义
  5. android listview、GridView中item点击后改变其他item中的状态 s
  6. Android(安卓)相关区域高度获取
  7. color 颜色代码 android res/values/colors.xml
  8. android SpannableString
  9. Android(安卓)中颜色对应的值

随机推荐

  1. android内从泄漏
  2. Android(安卓)Studio导入AOSP项目
  3. 为何GoogleSearch中可以嵌入EditText?
  4. Android(安卓)应用权限管理默认开关的修
  5. Android(安卓)捕获App意外退出错误的日志
  6. Android平台的手机记账应用开发教程
  7. Android屏幕分辨率详解(VGA、HVGA、QVGA、
  8. 阅读Android消息机制源码的随手笔记
  9. Android(安卓)动画效果(一)
  10. android 使用android.support.v7 添加Act