laufen Ich habe Android Studio 2.2.2 undAndroid Studio, Tabs zeigen nicht, wenn ich das Projekt
ich ein einfaches Projekt mit einem TabHost und ein Textview „Hallo Welt“ zu erstellen, dann betreibe ich das Projekt mit USB concetion zu meinem Handy und wenn die App runnig ist sehe ich nicht die TabHost, Ich kann nur die "Hallo Welt" Textview .... die Registerkarte ist fehlt.
Das Projekt ist sehr einfach, nur um das Problem zu zeigen.
* Im Projekt res/layout/activity_main.xml
Sie die TabHost sehen sehr gut
Vielen Dank im Voraus
Beispiel:
MainActivity.java
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
activity_main.xml (Relative-Layout)
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:id="@+id/textView" />
<TabHost
android:layout_width="200dip"
android:layout_height="300dip"
android:layout_below="@+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/tab1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:id="@+id/tab2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:id="@+id/tab3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
</FrameLayout>
</LinearLayout>
</TabHost>
Beitrag die Haupttätigkeit, welche Führer verweisen u, wenn Sie dies geschrieben hat? –