【问题标题】:iPhone- like tab bar in Android?Android中的类似iPhone的标签栏?
【发布时间】:2010-07-25 20:57:00
【问题描述】:

在 iPhone 中,我们可以创建一个带有标签栏的视图并将其设置为应用程序的根视图,然后使用标签栏在子视图中导航。

在 Android 中最接近此的方法是什么?

是否使用选项卡式控件?但这包括只使用一项活动。

在 Android 中使用什么方法以类似于 iPhone 的方式创建一个带有导航控件到其他 Activity 的 Activity?

【问题讨论】:

标签: android android-tabhost


【解决方案1】:

在 android 开发网站上有一个 tutorial 用于创建“选项卡布局”:

您可以在 两种方式之一:使用标签交换 同一个Activity中的视图,或者使用 完全改变的标签 单独的活动


(来源:android.com

【讨论】:

    【解决方案2】:

    抱歉,我真的不了解 iPhone,但 QuickAction Dialog 可以帮助您吗??

    http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/

    我想象了该对话框中一些活动的列表。

    我希望这接近你想要的。

    【讨论】:

      【解决方案3】:
      【解决方案4】:
      <?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:layout_marginBottom="0dp" 
      >
          <FrameLayout
          android:id="@android:id/tabcontent"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"            
          android:layout_weight="1" 
          />
      
          <TabWidget
          android:id="@android:id/tabs"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="0"
         />
      </LinearLayout>
      </TabHost>
      

      【讨论】:

      • TabHost、TabActivity 等已经贬值了吧?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多