我正在尝试在一个Android 2.2项目中使用Fragments和ActionBar。当使用"?android:attr/actionBarSize"时出现了一些错误,请问如何正确获取和设置该值?
示例:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/frags">
<fragment class="com.example.android.hcgallery.TitlesFragment"
android:id="@+id/frag_title"
android:visibility="gone"
android:layout_marginTop="?android:attr/actionBarSize"
android:layout_width="@dimen/titles_size"
android:layout_height="match_parent" />
<fragment class="com.example.android.hcgallery.ContentFragment"
android:id="@+id/frag_content"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
错误:未找到与给定名称匹配的资源(位于'value?android:attr / actionBarSize'处的'layout_marginTop')。