简体   繁体   English

如何定位屏幕左侧的选项卡?

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

I implemented a simple tab layout by following the tuturial .我按照教程实现了一个简单的选项卡布局

In the tutorial, the tabs are located on top of the screen.在本教程中,选项卡位于屏幕顶部。 Is there any way to locate the tabs on the left side of the screen instead of locating tabs on the top?有没有办法找到屏幕左侧的选项卡而不是顶部的选项卡? How to change the layout xml file?如何更改布局 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 doesn't support handle tabs on the left side but here there is a possible alternative: TabActivty 不支持左侧的句柄标签,但这里有一个可能的替代方案:

Existing patches for android tabwidget to allow tabs on left-hand side? android tabwidget 的现有补丁允许左侧的选项卡?

Another solution, is to write your own tab widget: http://groups.google.com/group/android-developers/browse_thread/thread/6587ffd8ea4ed74a#另一种解决方案是编写自己的标签小部件: 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