12
Tôi có một máy chủ lưu trữ tab trong đó tôi có nhiều hơn 6 nút. Tuy nhiên màn hình chỉ hiển thị 3-4 nút.Thêm cuộn trong tabhost trong android
Sau đây là mã mà tôi đang sử dụng cùng với hình ảnh.
<?xml version="1.0" encoding="utf-8"?>
<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"
android:background="#777777">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout
android:id="@+id/layTab"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:background="@drawable/navbar_background"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
/>
</RelativeLayout>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_above="@+id/layTab"/>
</RelativeLayout>
</TabHost>
Câu hỏi đặt ra là, làm thế nào tôi giả sử để thêm một cuộn giấy để tôi có thể di chuyển tối đa tất cả 6 nút hoặc bất kỳ thủ thuật khác.
Trân trọng
không làm việc cho điều này, tôi không cần nhóm radio: d –
Vâng, tôi đã làm sai. TabWidget cần được lồng nhau ... Tôi đã chỉnh sửa câu trả lời của mình. Hãy thử nó ngay bây giờ –
Nó cũng cần thiết để lồng các HorizontalScrollView bên trong hai RelativeLayouts? Làm tổ của tôi như sau: Tương đối> TabHost> Tuyến tính> Ngang> TabWidget và nó không cuộn. Bạn có nghĩ API có thể đã thay đổi kể từ năm 2012 không? – James