【问题标题】:How to locate tabs on the left side of screen?如何定位屏幕左侧的选项卡?
【发布时间】:2011-09-26 14:40:24
【问题描述】:

我按照tuturial 实现了一个简单的标签布局。

在本教程中,选项卡位于屏幕顶部。有什么方法可以将标签定位在屏幕左侧而不是定位在顶部?如何更改布局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>

【问题讨论】:

    标签: android android-layout android-emulator android-widget


    【解决方案1】:

    TabActivty 不支持左侧的句柄标签,但这里有一个可能的替代方案:

    Existing patches for android tabwidget to allow tabs on left-hand side?

    另一种解决方案是编写自己的选项卡小部件: http://groups.google.com/group/android-developers/browse_thread/thread/6587ffd8ea4ed74a#

    【讨论】:

      猜你喜欢
      • 2011-10-03
      • 2023-03-19
      • 1970-01-01
      • 1970-01-01
      • 2015-06-10
      • 1970-01-01
      • 2012-12-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多