erstellen tabindicator.xml, wie folgend.
Fügen Sie dann folgenden Code in Ihre TabActivity-Klasse ein. ...
View indicator1 = getLayoutInflater().inflate(R.layout.tabindicator,
null);
im1 = (ImageView) indicator1.findViewById(R.id.icon);
im1.setBackgroundDrawable(getResources().getDrawable(
R.drawable.home));
View indicator2 = getLayoutInflater().inflate(R.layout.tabindicator,
null);
im2 = (ImageView) indicator2.findViewById(R.id.icon);
im2.setBackgroundDrawable(getResources().getDrawable(
R.drawable.account));
mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator(
indicator1).setContent(new Intent(this, Home.class)));
mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator(
indicator2)
.setContent(new Intent(this, Accounts.class)))
In Hier können Sie tabindicator.xml entsprechend Ihrer Anforderung ändern.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageView android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"/>
</RelativeLayout>
Simple & Einfach zu implementieren! Vielen Dank! – Ahmed