Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-26713

Android: TabGroup "tabsBackgroundColor" property ignored when landscape

    Details

    • Story Points:
      8
    • Sprint:
      2019 Sprint 1

      Description

      Summary:
      TabGroup property "tabsBackgroundColor" will only apply the color to the top tab bar's background when the app is shown in "portrait" orientation. When "landscape", the color is ignored and will use the ActionBar's background color instead.

      Not that this is because the tab bar is moved inside of the ActionBar when landscape. The work-around is to set the ActionBar's "primaryColor" via an XML theme instead. Also, note that implementing tab bars via an ActionBar is considered deprecated as of Android 5.0 as well.

      Steps to reproduce:

      1. Build and run the below code on Android.
      2. Hold the device portrait.
      3. Notice that the top tab bar's background color is red. (This is good.)
      4. Rotate to landscape.
      5. Notice top tab bar is dark gray. (This is the issue.)

      function createTab(title) {
      	var window = Ti.UI.createWindow({ title: title });
      	window.add(Ti.UI.createLabel({ text: title + " View" }));
      	var tab = Ti.UI.createTab({
      		title: title,
      		window: window,
      	});
      	return tab;
      }
       
      var tabGroup = Ti.UI.createTabGroup({
      	tabs: [createTab("Tab 1"), createTab("Tab 2")],
      	tabsBackgroundColor: "red",
      });
      tabGroup.open();
      

      Result:

      Expected Result:

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ybanev Yordan Banev
                Reporter:
                jquick Joshua Quick
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-6815
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code