/ / Eclipse fügen Sie tabhost hinzu, um Fehler zu projizieren - android, eclipse, android-tabhost

Eclipse fügen Sie tabhost hinzu, um Fehler zu projizieren - android, eclipse, android-tabhost

Wenn ich versuche, einen TabHost mit hinzuzufügen

RightClick > New > Android XML > Select Root Element :TabHost

Es zeigt Tabhost benötigt ein Tabwidget und Frame-Layout.

Eigentlich ist tabhost die Wurzel. Wie kann ich eine haben? Tabwidget und Rahmenlayout Vor ?

Ist das Schuld der Finsternis oder meiner?

Antworten:

0 für die Antwort № 1

Ich konnte Layout mit Root TabHost als erstellenSie haben auf Eclipse 3.7.1 ohne Fehler beschrieben. Ich glaube, als Workaround können Sie Layout mit LinearLayout als root erstellen und entweder TabHost darin einfügen oder LinearLayout mit TabHost wechseln.

bearbeiten:

<?xml version="1.0" encoding="utf-8"?>
<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</TabWidget>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</FrameLayout>
</TabHost>

1 für die Antwort № 2

Diese Funktion sollte so funktionieren, wie Sie es nach der Installation von ADK 2.3.3 Update 2 mit Eclipse 3.7.1 beschrieben haben.