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

iOS: Percentage-based views need to be re-drawn on device rotation

    Details

      Description

      Views that have widths or positioning points based on percentages (e.g. "width: 20%" or "left: 20%") do not properly get updated on device rotation.

      Demonstration video: http://screencast.com/t/OmNKkLNHlW

      As you can see, switching away from the tab and back to it properly renders the views.

      var tabGroup = Titanium.UI.createTabGroup();
      var win1 = Titanium.UI.createWindow({ title: 'Tab 1', backgroundColor: '#fff' });
      var tab1 = Titanium.UI.createTab({ icon: 'KS_nav_views.png', title: 'Tab 1', window: win1 });
       
      var v1 = Ti.UI.createView({
      	backgroundColor: '#f00',
      	width: '20%',
      	left: '30%',
      	top: 0,
      	height: '100%'
      });
       
      var v2 = Ti.UI.createView({
      	backgroundColor: '#0f0',
      	width: '20%',
      	right: '30%',
      	top: 0,
      	height: '100%'
      });
       
      win1.add(v1);
      win1.add(v2);
      var win2 = Titanium.UI.createWindow({ title: 'Tab 2', backgroundColor: '#fff' });
      var tab2 = Titanium.UI.createTab({ icon: 'KS_nav_ui.png', title: 'Tab 2', window: win2 });
      var label2 = Titanium.UI.createLabel({ color: '#999', text: 'I am Window 2', font: { fontSize: 20, fontFamily: 'Helvetica Neue' }, textAlign: 'center', width: 'auto' });
      win2.add(label2);
      tabGroup.addTab(tab1);
      tabGroup.addTab(tab2);
      tabGroup.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                blainhamon Blain Hamon
                Reporter:
                matthewcongrove Matthew Congrove
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration