superSharp
- Forum-Beiträge: 89
17.11.2013, 15:03:20 via Website
17.11.2013 15:03:20 via Website
Hi,
ich hab ein Problem mit dem TabHost-Element. In allen Beispielen (http://www.androidhive.info/2011/08/android-tab-layout-tutorial/) die ich bis jetzt gefunden hab, wird in der main-Activity der TabHost so aufgerufen:
Ich hab exakt das gleiche XML verwendet und trotzdem gibt es die Funktion bei mir nicht?
XML:
ich hab ein Problem mit dem TabHost-Element. In allen Beispielen (http://www.androidhive.info/2011/08/android-tab-layout-tutorial/) die ich bis jetzt gefunden hab, wird in der main-Activity der TabHost so aufgerufen:
1TabHost tabHost = getTabHost();
Ich hab exakt das gleiche XML verwendet und trotzdem gibt es die Funktion bei mir nicht?
XML:
1<?xml version="1.0" encoding="utf-8"?>
2<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
3 android:id="@android:id/tabhost"
4 android:layout_width="fill_parent"
5 android:layout_height="fill_parent">
6 <LinearLayout
7 android:orientation="vertical"
8 android:layout_width="fill_parent"
9 android:layout_height="fill_parent">
10 <TabWidget
11 android:id="@android:id/tabs"
12 android:layout_width="fill_parent"
13 android:layout_height="wrap_content" />
14 <FrameLayout
15 android:id="@android:id/tabcontent"
16 android:layout_width="fill_parent"
17 android:layout_height="fill_parent"/>
18 </LinearLayout>
19</TabHost>
2<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
3 android:id="@android:id/tabhost"
4 android:layout_width="fill_parent"
5 android:layout_height="fill_parent">
6 <LinearLayout
7 android:orientation="vertical"
8 android:layout_width="fill_parent"
9 android:layout_height="fill_parent">
10 <TabWidget
11 android:id="@android:id/tabs"
12 android:layout_width="fill_parent"
13 android:layout_height="wrap_content" />
14 <FrameLayout
15 android:id="@android:id/tabcontent"
16 android:layout_width="fill_parent"
17 android:layout_height="fill_parent"/>
18 </LinearLayout>
19</TabHost>
1R.id.tabHost
gibts bei mir nicht — geändert am 17.11.2013, 15:03:59
Empfohlener redaktioneller Inhalt
Mit Deiner Zustimmung wird hier ein externer Inhalt geladen.
Mit Klick auf den oben stehenden Button erklärst Du Dich damit einverstanden, dass Dir externe Inhalte angezeigt werden dürfen. Dabei können personenbezogene Daten an Drittanbieter übermittelt werden. Mehr Infos dazu findest Du in unserer Datenschutzerklärung.