Android : Tab Host Align text center vertically not working in Android

on Tuesday, October 28, 2014


Tab Host Plain text only(no image) with vertical center not working. I tried bellow code, but no luck. Please any one can help me.


AndroidTabLayoutActivity.java



setContentView(R.layout.main);
TabHost tabHost = getTabHost();
TabSpec photospec = tabHost.newTabSpec("Photos");
photospec.setIndicator("Photos");
Intent photosIntent = new Intent(this, PhotosActivity.class);
photospec.setContent(photosIntent);
tabHost.addTab(photospec);


main.xml



<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">
<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"/>
</LinearLayout>
</TabHost>


i want this urgently. Thanks for advance.


0 comments:

Post a Comment