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

Android: View changes size after device rotation

    Details

    • Type: Bug
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: Release 2.1.0, Release 3.1.0
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      Titanium Studio, build: 2.1.0.201206172244
      Titanium SDK: 2.1.0.v20120618154152
      Device: Motorola Xoom 4.0.3

      Description

      Description:
      The red square changes it's size after the "Start" button pressed and the device is rotated.

      Not a regression, occurs in 2.0.2 as well.

      Steps to reproduce:
      1. Run an attached code

       
      var win = Ti.UI.currentWindow;
      win.backgroundColor = 'white';
       
      var buttonStart = Ti.UI.createButton({
      	title: 'Start',
      	top: 20,
      	height: Ti.UI.SIZE,
      	width: Ti.UI.SIZE
       
      });
      var buttonFinish = Ti.UI.createButton({
      	title: 'Finish',
      	top: 140,
      	height: Ti.UI.SIZE,
      	width: Ti.UI.SIZE	
      });
      var buttonUpdate = Ti.UI.createButton({
      	title: 'Update',
      	top: 260,
      	height: Ti.UI.SIZE,
      	width: Ti.UI.SIZE
      });
       
      buttonStart.addEventListener('click', function()
      {	
      	view.startLayout();
      	view.width = 75;
      	view.height = 75;
      	// view.backgroundColor = 'blue'; will not be affected by startLayout/finishLayout; not a layout parameter
      });
       
      buttonFinish.addEventListener('click', function()
      {	
      	view.finishLayout();
      });
       
       
      buttonUpdate.addEventListener('click', function()
      {	
      	view.updateLayout({
      		// backgroundColor: 'yellow', will not be affected by updateLayout; not a layout parameter
      		height: 100,
      		width:100
      	});
      });
       
       
      var view = Ti.UI.createView({
      	backgroundColor: 'red',
      	height: 50,
      	width: 50,
      	top: 330
      })
       
       
      win.add(buttonStart);
      win.add(buttonFinish);
      win.add(buttonUpdate);
      win.add(view);
      
      

      2. Press Start button
      4. Rotate the device

      Actual result:
      The red square has a different size.

      Expected results:
      Red square should stay the same size.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              oromero Olga Romero
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

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

                  Git Source Code