Tab Widget in android:
horizontal_menubar_layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<HorizontalScrollView
android:id="@+id/bottomBar"
android:scrollbarTrackHorizontal="@drawable/scrollbar_horizontal_track"
android:scrollbarThumbHorizontal="@drawable/scrollbar_horizontal_thumb"
android:scrollbarSize="2dip"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:background="@drawable/bottom_bar"
android:layout_height="60dip">
<LinearLayout android:layout_width="fill_parent"
android:orientation="horizontal"
android:layout_height="fill_parent">
<Button
android:layout_width="wrap_content"
android:id="@+id/botbuthome"
android:drawableTop="@drawable/homeicon"
android:text="@string/Home"
android:textColor="#ffffff"
android:textStyle="bold"
android:textSize="12dip"
android:background="@drawable/transparent"
android:layout_height="wrap_content" android:gravity="top|center_horizontal" android:layout_marginLeft="18dip"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/botbutinbox"
android:drawableTop="@drawable/inboxtrans"
android:gravity="center_horizontal|center_vertical"
android:text="@string/Inbox"
android:textColor="#ffffff"
android:textStyle="bold"
android:textSize="12dip"
android:background="@drawable/transparent" android:layout_marginLeft="22dip"/>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
Horizontal_layout class
public class Horizondal_MenuBar_Layout extends LinearLayout
{
public Horizondal_MenuBar_Layout(Context context, AttributeSet attrs)
{
super(context, attrs);
LayoutInflater layoutInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view=layoutInflater.inflate(R.layout.horizontal_menubar_layout,this);
}}
Call this in Xml
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:gravity="bottom">
<package name.classname
android:layout_height="wrap_content"
android:layout_width="fill_parent"/>
</RelativeLayout>
0 comments: