根据UIButton的压力,同一个布特顿必须履行不同的任务。
如何计算UIButton的期限?
根据UIButton的压力,同一个布特顿必须履行不同的任务。
如何计算UIButton的期限?
用户可向纽芬兰州提出2项行动,衡量这两种方法之间的时间:
UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn.frame = CGRectMake(100.0, 100.0, 100.0, 20.0);
[btn setTitle:@"Test" forState:UIControlStateNormal];
[btn addTarget:self action:@selector(userEndsTap:) forControlEvents:UIControlEventTouchUpInside];
[btn addTarget:self action:@selector(userStartsTap:) forControlEvents:UIControlEventTouchDown];
以及用两种方法衡量你的任期:
- (void)userEndsTap:(id)sender {
NSLog(@"user ends tap");
// stop measurement an do something different for different durations
}
- (void)userStartsTap:(id)sender {
NSLog(@"user starts tap");
// start measurement
}
Attach a UILongPressGestureRecognizer
to your button and set the minimumPressDuration
property.
You can attach multiple gesture recognizers to the same button for different minimal press duration.
如果你在不同的姿态识别器之间有“冲突”,你可以用<代码>-requireGestureRecognizer ToFail:来说明,只有在对方不承认的情况下,才能确认姿态。
查阅。
I have a UIToolbar that needs three buttons in a radio style, meaning that of the three, only one button can be pushed at a time. The documentation makes reference to the possibility of setting up ...
I have a UITextField that is a subview of a UITableViewCell. When my view loads, I want the text field to become first responder. I have a pointer to the text field in the table cell, so to do this I ...
I want to allow the user to enter a valid date using the iPhone’s settings application. I have experimented with many of the PreferenceSpecifiers data node types including date. I have two issues: ...
I m going to use an example to properly illustrate my confusion. I can t quite wrap my head around this. In Cocoa touch, we have UIViewController and its subclass, UINavigationController. Now, UIVC ...
Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...
I have an app which has to load some data at startup, so I want to display a splash-screen animation. I m using the MPMoviePlayerController to play a m4v file. The movie has it s background set to [...
Is there a way to add a location from an MKMapView in my application to the built-in Google Maps app? From what I understand there is probably one of two ways to do it: using [[UIApplication ...
I m trying to chain animation events. The application I m coding for work has a multiple choice quiz. First you pick your multiple choice answer. The quiz view fades away. Then a label ("correct" or "...