Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27236] iOS: Animating view width/height from 0 doesn't work

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2021-06-15T08:43:08.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.0.1
ComponentsiOS
Labelsanimate, animation, ios, view
ReporterACI Informatica
AssigneeJoshua Quick
Created2019-06-11T10:14:16.000+0000
Updated2021-06-15T08:43:08.000+0000

Description

*Problem* Animating View height/width from 0 doesn't work on iOS. *Test case*

Execute below code

View height remains 0 and no animation is present.

$.win.open();

function onClick() {
	$.v1.animate({ duration: 500, height: 200 });
}
<Alloy>
	<Window id="win">
			<View id="v1"/>
			<Button id="btn" onClick="onClick" />
	</Window>
</Alloy>
"#win": {
	backgroundColor: 'white'
}

"#v1": {
	height: 0,
	width: 200,
	backgroundColor: 'red'
}

"#btn": {
	height: 40,
	width: 260,
	bottom: 48,
	backgroundColor: 'green',
	title: 'Animate'
}

Attachments

FileDateSize
AnimationSizeTest.js2021-05-21T21:31:02.000+0000766

Comments

  1. Sharif AbuDarda 2019-07-29

    Hello [~vijaysingh], Can you please look into this issue? It's reproducible using the latest SDK 8.0.2.GA. Thank you.
  2. Vijay Singh 2019-07-30

    [~sdarda] A quick workaround is - Set view's (v1) initial height/width > 0. e.g .0001, which is practically ~0.
       "#v1": {
       	height: .0001,
       	width: 200,
       	backgroundColor: 'red'
       }
       
  3. Joshua Quick 2021-05-21

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12832
  4. Christopher Williams 2021-06-14

    Merged to master
  5. Ewan Harris 2021-06-15

    10_0_X PR merged

JSON Source