`
iaiai
  • 浏览: 2141950 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

fitsSystemWindow作用

 
阅读更多
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:fitsSystemWindows="false">
...
</android.support.design.widget.CoordinatorLayout>


代码中看到android:fitsSystemWindows这么一个属性,这是什么意思呢?

引用

英文文档注释为:
Boolean internal attribute to adjust view layout based on system windows such as the status bar. If true, adjusts the padding of this >view to leave space for the system windows. Will only take effect if this view is in a non-embedded activity.

引用

经过具体实验,具体的作用就是你的contentview是否忽略actionbar,title,屏幕的底部虚拟按键,将整个屏幕当作可用的空间。
正常情况,contentview可用的空间是去除了actionbar,title,底部按键的空间后剩余的可用区域;这个属性设置为true,则忽略,false则不忽略

具体什么意思呢,请看下面图片
设置为true

设置为false
  • 大小: 36.8 KB
  • 大小: 28.3 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics