14

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

Android中最接近这个的方法是什么?

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

在 Android 中使用类似于 iPhone 的方式创建带有导航控件到其他活动的活动的方法是什么?

4

4 回答 4

13

在 android 开发网站上有一个创建“选项卡布局”的教程:

您可以通过以下两种方式之一实现您的选项卡内容:使用选项卡在同一活动中交换视图,或使用选项卡在完全独立的活动之间进行切换

选项卡布局
(来源:android.com

于 2010-07-26T01:09:50.067 回答
3

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

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

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

我希望这接近你想要的。

于 2010-07-25T22:00:23.850 回答
2

周围有几个例子

http://www.anddev.org/code-snippets-for-android-f33/iphone-tabs-for-android-t14678.html

这是可滚动的 http://code.google.com/p/mobyfactory-uiwidgets-android/

于 2010-07-26T12:03:23.123 回答
1
<?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>
于 2011-01-28T09:19:18.990 回答