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

Android: Launching TabGroup in landscape and then rotating to portrait won't resize tabs as of 8.0.0

    Details

      Description

      Summary:
      On Android, tabs are supposed to be sized as follows depending on the orientation...

      • Portrait: Stretched horizontally to fill the window.
      • Landscape: Sized to just fit the tab text.

      When launching a TabGroup in "landscape" orientation, the tabs are sized correctly. However, when rotating to "portrait" afterwards, the tabs won't resize to fill the window. They are still sized to fit the tab text which is not the native behavior.

      Note that this is not an issue when launching a TabGroup in "portrait" form. The tabs resize correctly when rotating to landscape and back to portrait. This is only an issue when launching in "landscape". This is also a regression as of Titanium 8.0.0 and was not an issue in prior Titanium versions.

      Steps to reproduce:

      1. Set up the project's "app.js" with the below code.
      2. Hold the Android device landscape.
      3. Build and run the app on the device while held landscape.
      4. Rotate to portrait.
      5. Notice that the top tabs do not fill the window horizontally when portrait.

      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")],
      });
      tabGroup.open();
      

      Result:

      Expected Result:

        Attachments

          Activity

            People

            • Assignee:
              ybanev Yordan Banev
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Joshua Quick
              Tester:
              Satyam Sekhri
            • Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code