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!
Du musst angemeldet sein, um einen Kommentar abzugeben.
Sollten Sie nur verwenden:
Sehen http://developer.android.com/training/basics/actionbar/overlaying.html
Für mich ersetzen
mit
half zu starten, app auf Android 2.2 und Android 4.3 ohne Probleme.
Ich denke, das problem ist, dass actionbar kommt mit android 3.0 und 2.2. Aber es ist ein Weg zu überspringen, diese durch eine Erweiterung namens "actionbarsherlock".