如何在Titanium iphone中为行高设置动画(How to animate row height in Titanium iphone)

编程入门 行业动态 更新时间:2024-10-28 18:34:23
如何在Titanium iphone中为行高设置动画(How to animate row height in Titanium iphone)

我正在使用Titanium iphone中的Table视图。 我试图为每一行添加动画样式。

也就是说,当用户点击每一行时,行高需要增加,所以我能够在行中显示隐藏的内容。 当用户再次点击时,行高度需要降低。

对于折叠视图,我的代码是

var animation = Ti.UI.createAnimation({height: 1, duration: 500}); row.animate(animation);

并且对于扩展视图,

row.animate(Ti.UI.createAnimation({ height:200, duration:300 });

但以上两个代码都不起作用,

如果我在不使用动画的情况下设置行高,则其工作正常。 如何为表视图行应用动画样式...可以任意一个。

I am working on Table view in Titanium iphone. I tried to add animation style for each row.

That is, when user click on each row , then row height need to increase, So I able to show hided contents in row. And when user click again then the row height need to decrease.

My code is, for collapsed view,

var animation = Ti.UI.createAnimation({height: 1, duration: 500}); row.animate(animation);

and for expanded view,

row.animate(Ti.UI.createAnimation({ height:200, duration:300 });

but above both code are not working,

If I set row height without using animation then its working fine. How to apply animation style for table view row... can any one please.

最满意答案

你可以试试这个

http://developer.appcelerator.com/question/119198/animating-row-height-changes

TableViewRow无法设置动画。 这是文档错误。 您需要创建自己的动画功能(即setTimeout)。

you can try this

http://developer.appcelerator.com/question/119198/animating-row-height-changes

TableViewRow cannot be animated. It's documentation bug. You need to make your own animation function (ie, setTimeout).

更多推荐

row,animation,视图,height,电脑培训,计算机培训,IT培训"/> <meta name="descr

本文发布于:2023-08-06 17:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1454217.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中为   动画   如何在   Titanium   height

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!