开发者

XCode UIPickerView Delay Select

开发者 https://www.devze.com 2023-04-07 12:41 出处:网络
I w开发者_JAVA百科ish the UIPIckerView would allow you to scroll then select but since it doesn\'t, is there a way to delay the auto select?For example, if I scroll down and it stops on an item, it in

I w开发者_JAVA百科ish the UIPIckerView would allow you to scroll then select but since it doesn't, is there a way to delay the auto select? For example, if I scroll down and it stops on an item, it instantly automatically selects that item. Is there any way to make it so that if it lands on the item, it must wait for example like 1-2 seconds before selecting? This way it gives to user more time to keep scrolling through the list.


I had the same problem. When I thought about it for a while I thought well just add an NSTimer. This is what I did:

[NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(delayTime) userInfo:nil repeats:NO];

and then I added a void statement:

-(void)delayTime { 
    //Add delayed code here
}

Hope that helps,

Seb

0

精彩评论

暂无评论...
验证码 换一张
取 消