How to make tabbar in Android to look like iPhone tabbar in XML

17031994

New Member
I want to make the tabbar of Android to look like Android.Here is my code:main.xml\[code\]<?xml version="1.0" encoding="utf-8"?><TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@android:id/tabhost" android:orientation="vertical" > <TabWidget android:layout_width="fill_parent" android:layout_height="40px" android:id="@android:id/tabs" android:layout_alignParentBottom="true" ></TabWidget></TabHost>\[/code\]TabActivity.java\[code\]package com.saa;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.widget.TabHost;import android.widget.TabHost.TabSpec;public class TabActivity extends android.app.TabActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TabHost tabHost=getTabHost(); Intent intent = new Intent(); TabSpec tabSpec= tabHost.newTabSpec("one"); tabSpec.setIndicator("One", getResources().getDrawable(R.drawable.ic_launcher)); intent.setClass(this, tab1.class); tabSpec.setContent(intent); tabHost.addTab(tabSpec); tabSpec= tabHost.newTabSpec("two"); tabSpec.setIndicator("Two", getResources().getDrawable(R.drawable.ic_launcher)); intent = new Intent().setClass(this, tab2.class); tabSpec.setContent(intent); tabHost.addTab(tabSpec); tabSpec= tabHost.newTabSpec("three"); tabSpec.setIndicator("Three", getResources().getDrawable(R.drawable.ic_launcher)); intent = new Intent().setClass(this, tab3.class); tabSpec.setContent(intent); tabHost.addTab(tabSpec); tabSpec= tabHost.newTabSpec("four"); tabSpec.setIndicator("Four",getResources().getDrawable(R.drawable.ic_launcher)); intent = new Intent().setClass(this, tab4.class); tabSpec.setContent(intent); tabHost.addTab(tabSpec); tabHost.setCurrentTab(0); // default tab }}\[/code\]What are the changes do I need to make in order for the Tabbar to got down? I have created other classes like tab1.java,tab2.java etc..
 
Back
Top