0
我正在使用水平滾動視圖,但標籤不滑動僅內容更改。請幫幫我。當我翻頁時,標籤不會翻轉。水平滾動視圖爲tabwiget不滑動標籤
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TabWidget>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="@+id/tab1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
<FrameLayout
android:id="@+id/tab2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
//
TabWidget tw = (TabWidget) rootView.findViewById(android.R.id.tabs);
LinearLayout ll = (LinearLayout) tw.getParent();
HorizontalScrollView hs = new HorizontalScrollView(getActivity());
hs.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT));
ll.addView(hs, 0);
ll.removeView(tw);
hs.addView(tw);
hs.setHorizontalScrollBarEnabled(false);
hs.setFillViewport(true);
當我翻動頁面,然後標籤不輕彈。
http://chat.stackoverflow.com/rooms/70243/farsi-programming-discussion – Kasramvd