Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12220] Android: cannot set TabGroup on bottom from SDK 3.0.0

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2013-01-15T12:40:55.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 02 API, 2013 Sprint 02
ComponentsAndroid
Labelsregression
ReporterDavide Cassenti
AssigneePing Wang
Created2013-01-07T06:10:53.000+0000
Updated2013-05-08T09:41:17.000+0000

Description

Problem description

Starting from SDK 3.0.0, it is not possible anymore to customize the position of the TabGroup bar, in order to set it at bottom.

Steps to reproduce

1. Create the default tabbed app 2. add the file platform/android/res/layout/titanium_tabgroup.xml with the following content:
<?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="0dp">
 
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:padding="0dp"
            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>
Running on SDK 2.1.4, the TabGroup is shown on bottom; with SDK 3.0.0 and 3.1.0 this is not working anymore.

Comments

  1. Ping Wang 2013-01-09

    Before SDK 3.0, we used [TabActivity](http://developer.android.com/reference/android/app/TabActivity.html) to implement the TabGroup. Since TabActivity is deprecated, we now use [TabHost](http://developer.android.com/reference/android/widget/TabHost.html) to implement the TabGroup for API level < 11 in SDK 3.0. We define the TabHost layout in the code. That's why the custom TabHost layout xml file does not work anymore. Based on the guideline of [Pure Android](http://developer.android.com/design/patterns/pure-android.html), the bottom tab bars are not recommended. In addition, for API level >= 11 we use ActionBar to implement the TabGroup, in which case tab bars can only be on the top. In order to provide a consistent experience, we don't recommend using bottom tab bars.
  2. Ping Wang 2013-01-15

    Resolve the ticket as Won't fix since it's never been supported in our SDK and it's not a recommended way to design Android apps.
  3. Allan Brazute 2013-01-28

    Hi. I understand and kind off agree to put tabs on top for a consistent experience. But since my app is multiplataform and I would like it to be the same experience on iOS, Android and HTML5, I must ask: With Ti SDK 3+, there is a way to render tabs at bottom on Android? Thank you.
  4. Ping Wang 2013-01-29

    Hi Allan, since the layout is hard coded in our code now I don't think there is a way to render tabs at bottom except writing your own module to do it.
  5. Alberto Marcone 2013-04-05

    Sorry, this doesn't mean only that you can't move it to the bottom, but even that you can't hide them (in case you want to still use the tabs for managing the windows), so you always HAVE to use them. Unless you open and close windows manually and lose the going back actions. (Es: if you open your windows using Ti.UI.currentTab.open(newWin) and then close it, you'll go back to your previous window, if you open it with newWin.open() you have a totally different behavior.) Saying that it's not possible and closing the ticket it's quite an easy solution.
  6. Michael DeGiovanni 2013-05-08

    Hi Ping Wang, you stated that you are using the TabHost layout , so why not at least enable controls on the tab such as for example hiding the Tabhost: http://kb.gosi.at/content/36/111/en/how-to-hide-tabwidget-of-tabhost.html

JSON Source