How to get “?android:attr/actionBarSize" mit Kompatibilitäts-Bibliothek

Ich versuche, die Fragmente und die ActionBar in Android 2.2-Projekt. Es gibt einige Fehler bei der Verwendung von "?android:attr/actionBarSize", wie get-und set-Wert korrekt?

Beispiel:

<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>

Error: No resource found entspricht dem angegebenen Namen (die bei 'layout_marginTop' mit dem Wert '?android:attr/actionBarSize').

  • hast du eine Lösung gefunden dafür? danke Kumpel!
InformationsquelleAutor flapjack | 2011-10-13
Schreibe einen Kommentar