2013年9月3日 星期二

Android Horizon Scroll TAB extends Activity only

/////////////in main.xml
xml version="1.0" encoding="utf-8"
RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="#C0000000"
android:cacheColorHint="#00000000"

TabHost
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">


RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

HorizontalScrollView
android:id="@+id/bottom_tabbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:fillViewport="true"
android:scrollbars="none"

TabWidget
android:id="@android:id/tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
HorizontalScrollView

FrameLayout
android:id="@android:id/tabcontent"
android:layout_above="@id/bottom_tabbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dp"
GridView
android:id="@+id/testchat_gridview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:columnWidth="60dp"
android:horizontalSpacing="10dp"
android:numColumns="auto_fit"
android:padding="10dp"
android:stretchMode="columnWidth"
android:verticalSpacing="10dp"
GridView
FrameLayout
RelativeLayout
TabHost

RelativeLayout

////////////////in Java

//FrameLayout
tabfact00 = new TabContentFactory()
{
@Override
public View createTabContent(String tag)
{
View tabview = createTabView(m_TabHost.getContext(), "Artists04");
//return new TextView(ScrollTabActivity.this);
return tabview;
}
};

//tab cell style
View tabview00 = createTabView(m_TabHost.getContext(), "Artists Tab");
m_TabHost.addTab(m_TabHost.newTabSpec("Artists Tab").setIndicator(tabview00).setContent(tabfact00));

//////////////////


Here is my download from fatalfeel@yahoo.com.tw extends "Activity" only
http://www.mediafire.com/download/843sznrgr3rmr3d/HorizonScrollTab_with_GridImage.zip

沒有留言:

張貼留言