Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13048] layout on view fall apart when using transition when view layout = vertical

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsios
ReporterMitchell Amihod
AssigneeUnknown
Created2013-03-11T14:55:13.000+0000
Updated2018-02-28T20:03:35.000+0000

Description

Problem description

When transitioning from two different views using UI.Animation, if the views have layout set to "vertical", the second window collapses.

Test case

//Transition Bug when view layout = vertical
/*
When view.layout = vertical
When transitioning from view1 to view2, we see view2 pretty much collapses.
As it's transitioning, you can see button2 for some reason takes up the whole view,
rather than respect its set width/height.
Basically, transitioning from one view to another seems broken.
*/


Ti.UI.setBackgroundColor('#000');
var win = Ti.UI.createWindow({
  height: Ti.UI.FILL,
  width: Ti.UI.FILL
});

var view1 = Ti.UI.createView({
  layout: "vertical",
  height: 200,
  width: 200,
  backgroundColor: "#cc0"
});

var textField1 = Ti.UI.createTextField({
  borderWidth: 1,
  borderColor: "#000",
  width: 100,
  height: 40
});

var button1 = Ti.UI.createButton({
  width: 100,
  height: 50,
  title: "Click To Transition"
});
view1.add(textField1);
view1.add(button1);


var view2 = Ti.UI.createView({
  layout: "vertical",
  height: 400,
  width: 400,
  backgroundColor: "#c0c"
});
var textField2a = Ti.UI.createTextField({
  borderWidth: 1,
  borderColor: "#000",
  width: 100,
  height: 40
});
var textField2b = Ti.UI.createTextField({
  borderWidth: 1,
  borderColor: "#000",
  width: 100,
  height: 40
});
var button2 = Ti.UI.createButton({
  width: 100,
  height: 50,
  title: "Click To Transition Back"
});

view2.add(textField2a);
view2.add(textField2b);
view2.add(button2);

button1.addEventListener('click', function() {
  var transition = Ti.UI.createAnimation({
    view: view2,
    transition: Ti.UI.iPhone.AnimationStyle.FLIP_FROM_RIGHT
  });
  view1.animate(transition);
});

button2.addEventListener('click', function() {
  var transition = Ti.UI.createAnimation({
    view: view1,
    transition: Ti.UI.iPhone.AnimationStyle.FLIP_FROM_RIGHT
  });
  view2.animate(transition);
});

win.add(view1);
win.open();

Attachments

FileDateSize
app.js2013-03-11T14:55:13.000+00001784

Comments

  1. Lee Morris 2017-06-19

    I'm not able to reproduce the issue here but when clicking "click transition" button, a purple view appears (which I presume is expected behaviour) and then a button "Click to transition back" appears and then disappears after a second. This was done using the following environment; iPhone 7 (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170609091155 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source