iPhone- like tab bar in Android?
Asked Answered
H

4

14

In iPhone we can create a view that has a tab bar and make it the root view of the application then use the tab bar to navigate through sub views.

what is the most close approach to this in Android?

Is it to use a Tabbed Control? but this includes using just one activity.

what is the approach to use in Android to create an activity with a navigation control to other activities in a way similar to that of the iPhone?

Hyperostosis answered 25/7, 2010 at 20:57 Comment(1)
Update: hi all, I've found another approach to do this. check my blogpost android-pro.blogspot.com/2010/08/…Hyperostosis
T
13

There's a tutorial for creating a "Tab Layout" on the android dev site:

You can implement your tab content in one of two ways: use the tabs to swap Views within the same Activity, or use the tabs to change between entirely separate activities

Tab Layout
(source: android.com)

Trodden answered 26/7, 2010 at 1:9 Comment(0)
B
3

Sorry, I really don't know the iPhone, but may a QuickAction Dialog help you??

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

I imagine a list of some activities in that dialog.

I hope this is close to what you want.

Burschenschaft answered 25/7, 2010 at 22:0 Comment(0)
T
2

There are a couple of examples around

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

This one is scrollable http://code.google.com/p/mobyfactory-uiwidgets-android/

Trevelyan answered 26/7, 2010 at 12:3 Comment(0)
B
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>
Babul answered 28/1, 2011 at 9:19 Comment(1)
TabHost, TabActivity etc is depreciated, isn't it?Gnu

© 2022 - 2024 — McMap. All rights reserved.