ustaw dolny pasek na pasku wszystkie czynności na Androida
Mam jedną aplikację na Androida.
Tutaj muszę ustawić pasek na dole wszystkich działań Androida. Jak mogę zrobić. Proszę dać mi rozwiązanie dla tych.
Mam całkowicie 10 działań, co oznacza, że pasek jest wyświetlany na wszystkich 10 aktywnościach. Jak mogę to zrobić w Android. Proszę mi pomóc.
To moja pierwsza aktywność:
setContentView(R.layout.tabbar);
TabHost tabHost = getTabHost();
TabHost.TabSpec spec;
Intent intent;
TabSpec dbspec = tabHost.newTabSpec("Home");
dbspec.setIndicator("Home", getResources().getDrawable(R.drawable.home));
Intent dbIntent = new Intent(this, MainActivity.class);
dbspec.setContent(dbIntent);
tabHost.addTab(dbspec);
TabSpec orderspec = tabHost.newTabSpec("Cart");
orderspec.setIndicator("Cart", getResources().getDrawable(R.drawable.cart));
Intent orderIntent = new Intent(this, ViewCartActivity.class);
orderspec.setContent(orderIntent);
tabHost.addTab(orderspec);
TabSpec settingspec = tabHost.newTabSpec("My Account");
settingspec.setIndicator("My Account", getResources().getDrawable(R.drawable.myaccount));
Intent settingIntent = new Intent(this, CustomerLogin.class);
settingspec.setContent(settingIntent);
tabHost.addTab(settingspec);
tabbar.xml:
<?xml version="1.0" encoding="utf-8"?>
<TabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:layout_width="match_parent"
android:id="@+id/linearLayout1"
android:layout_height="match_parent">
<TabWidget
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@android:id/tabs"
android:layout_alignParentBottom="true">
</TabWidget>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@android:id/tabcontent">
</FrameLayout>
</RelativeLayout>
</TabHost>
W pierwszej zakładce trzeba wykonać MainActivity (GridView) activity.it jest woked well.in Główna aktywność muszę clik dowolny element oznacza to iść do SubCate (listview) aktywności.Tutaj również muszę wyświetlić tabbar na dole.Jak mogę zestaw.
W pliku podrzędnym.xml znajduje się poniższy kod:
<include
android:id="@+id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
layout="@layout/tabbar" />
ale tabulator nie jest wyświetlany.nieprawda tutaj. proszę mi pomóc.