R
Rotesmofa
Erfahrenes Mitglied
- 20
Hallo Jungs,
ich habe gerade meine App auf ein TapHost Layout umgefriemelt, nun hab ich allerdings ein Problem.
Ich habe das gut beschriebene Beispiel: Tab Layout | Android Developers genutzt und es funktioniert auch tadellos.
Problem 1: Ich bekomme mit der angehängten layout.xml eine NullPointerException im Eclipse Layout Window. Kennt einer den Grund?
Problem 2: Ich möchte das Layout in den Tabs um jeweils eine unterschiedliche Anzahl Buttons oder TextViews erweitern. Wie gehe ich dann vor? Erstelle ich die Buttons und TextViews im main.xml file und schalte sie dann nach Bedarf sichtbar? oder gibts da ne elegantere Alternative?
Gruß
Rotesmofa
Hier meine main.xml (also mein layout file)
ich habe gerade meine App auf ein TapHost Layout umgefriemelt, nun hab ich allerdings ein Problem.
Ich habe das gut beschriebene Beispiel: Tab Layout | Android Developers genutzt und es funktioniert auch tadellos.
Problem 1: Ich bekomme mit der angehängten layout.xml eine NullPointerException im Eclipse Layout Window. Kennt einer den Grund?
Problem 2: Ich möchte das Layout in den Tabs um jeweils eine unterschiedliche Anzahl Buttons oder TextViews erweitern. Wie gehe ich dann vor? Erstelle ich die Buttons und TextViews im main.xml file und schalte sie dann nach Bedarf sichtbar? oder gibts da ne elegantere Alternative?
Gruß
Rotesmofa
Hier meine main.xml (also mein layout file)
Code:
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp" >
</FrameLayout>
</LinearLayout>
</TabHost>