How to delay to load the button on image view in iphone
I am new to iphone development. I have created a view controller and sets开发者_运维百科 the button on the view. On clicking the button, it navigates to the next view and loaded the image in the view. Now i want to display the button on after loaded the image. The button will be shown after 3 seconds on the image view.
Please help me out,
Thanks.
Use NSTimer
In viewDidLoad
[NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(updateCounter:) userInfo:nil repeats:NO];
create a "updateCounter" custom method to display the button
- (void)updateCounter:(NSTimer *)theTimer {
display the button here...
}
All the Best.
You need to use a NSTimer.
When the view loads, set the timer for 3 seconds and configure it to evoke a custom method of the view controller. That method should add the button to the view.
精彩评论