제가 tabhost를 사용중인데
탭 위젯을 추가하다보니 화면 크기보다 위젯 크기가 더 커서 horizontalscrollview 를 이용해 좌우로 스크롤 할수있도록 디자인 할려고하는데
horizontalscrollview가 정상적으로 좌우로 스크롤이 안되서 이렇게 질문드립니다 .
tabhost.xml
<TabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent">
<HorizontalScrollView
android:id="@+id/HorizontalScroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="horizontal"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weightSum="4"
>
</TabWidget>
</LinearLayout>
</HorizontalScrollView>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="602dp"
>
<LinearLayout
android:id="@+id/tab1"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/koreafood"
android:layout_width="match_parent"
android:layout_height="match_parent">
</ListView>
</LinearLayout>
tabhost.java
@SuppressWarnings("deprecation")
public class foodtabhost extends TabActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.foodtabhost);
TabHost tabHost = getTabHost();
TabHost.TabSpec korea=tabHost.newTabSpec("korea").setIndicator("한식");
korea.setContent(R.id.tab1);
tabHost.addTab(korea);
TabHost.TabSpec china=tabHost.newTabSpec("china").setIndicator("중국집");
china.setContent(R.id.tab2);
tabHost.addTab(china);
TabHost.TabSpec chiken=tabHost.newTabSpec("chiken").setIndicator("치킨");
chiken.setContent(R.id.tab3);
tabHost.addTab(chiken);