Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20044] Cannot apply simple animations to views having zero width on iOS

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionDuplicate
Resolution Date2021-05-21T21:28:29.000+0000
Affected Version/stitanium 5.0.5
Fix Version/sn/a
ComponentsiOS
Labelsanimations, engTriage, ios
ReporterSelim Ghdiri
AssigneeUnknown
Created2015-11-16T10:31:02.000+0000
Updated2021-05-21T21:28:33.000+0000

Description

Trying to apply simple animation to a view in order to modify its size (open/close effect), the animation could not be appliedon iOS devices when the view's width is zero. The same example is working perfectly on Android. How to reproduce on a simple example: index.xml
<Alloy>
	<Window class="container" layout="vertical" height="100%" width="100%">
		<View height="20%" width="Ti.UI.FILL" layout="horizontal">
			<Button onClick="close" title="close"></Button>
			<Button onClick="open" title="open"></Button>
		</View>
		<View height="80%" width="Ti.UI.FILL" layout="horizontal">
			<View id="left" width="50%" backgroundColor="red"></View>
			<View id="right" width="50%" ></View>
		</View>
		
	</Window>
</Alloy>
index.js
function open(e) {
    var anim = Ti.UI.createAnimation({
		width : "50%",
		duration : 2000,
		curve : Ti.UI.ANIMATION_CURVE_EASE_IN_OUT
	});
	$.left.animate(anim);
}
function close(e) {
    var anim = Ti.UI.createAnimation({
		width : "0%",
		duration : 2000,
		curve : Ti.UI.ANIMATION_CURVE_EASE_IN_OUT
	});
	$.left.animate(anim);
}

$.index.open();
when the width is set to 1% in the close animation, the open animation is working properly but when set to 0% it's impossible to reopen the view.

Comments

  1. Alan Hutton 2019-10-15

JSON Source