iPhone设置了一些时间延迟
你好;
在我的 iPhone 应用程序中的 UipickerView 中,我可以通过编程方式向上或向下移动选取器值吗?
添加像选取器仅移动自身这样的动画效果 为此,
[picker selectRow:0 inComponent:0 animated:YES];
---- ---
//here I need Some time delay
[picker selectRow:3 inComponent:0 animated:YES];
我怎样才能在这两个语句的执行之间给出一些时间延迟
请帮助并建议
谢谢
HI;
In my iPhone App in UipickerView can I move picker Values up or down Programmatically
To add effect of an animation like picker is moving itself only
for that
[picker selectRow:0 inComponent:0 animated:YES];
---- ---
//here I need Some time delay
[picker selectRow:3 inComponent:0 animated:YES];
How can I give some time delay between execution of this two statements
Please help and Suggest
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果你想添加一些延迟,你可以使用:
但这会阻塞你的应用程序,所以最好使用计时器:
这应该在主线程上执行,因为 UIKit 不是线程安全的
If you want to add some delay, you could use :
But this will block your application, so it can be better to use a timer :
This should be performed on main thread, since UIKit is not thread safe
你说的是这个方法
You mean this method
您可以尝试通过
performSelector: withObject: afterDelay:
方法在延迟后调用第二个选择You can try calling the second selection after a delay through
performSelector: withObject: afterDelay:
method这个怎么样:
它对我来说就像魅力一样!
我以为这永远不会成功,但它非常好!
what about this:
It worked for me like a charm!
I thought this will never gonna work, but it is pretty fine!