您的位置:首页 > 其它

笔记:在XML文件中获取ActionBar的宽度

2016-04-23 13:12 246 查看
主要用于4000ActionBar为overlay(覆盖)模式下,不覆盖掉原来要显示出来的布局不使用支持库
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingTop="?android:attr/actionBarSize">
    ...
</RelativeLayout>
<!-- 使用支持库  Support library compatibility --><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:paddingTop="?attr/actionBarSize">    ...</RelativeLayout>
In this case, the [code]?attr/actionBarSize
 value without the prefix works on all versions, including Android 3.0 and higher.[/code]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: