主要用于ActionBar为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 ?attr/actionBarSize
value without the prefix works on all versions, including Android 3.0 and higher.