簡體   English   中英

如何定位屏幕左側的選項卡?

[英]How to locate tabs on the left side of screen?

我按照教程實現了一個簡單的選項卡布局

在本教程中,選項卡位於屏幕頂部。 有沒有辦法找到屏幕左側的選項卡而不是頂部的選項卡? 如何更改布局 xml 文件?

<?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">
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="5dp">
        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" />
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:padding="5dp" />
    </LinearLayout>
</TabHost>

TabActivty 不支持左側的句柄標簽,但這里有一個可能的替代方案:

android tabwidget 的現有補丁允許左側的選項卡?

另一種解決方案是編寫自己的標簽小部件: http://groups.google.com/group/android-developers/browse_thread/thread/6587ffd8ea4ed74a#

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM