UIButton *btn=[UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[btn setFrame:CGRectMake(0, 0, 20, 20)];
[btn addTarget:self action:@selector(countup:) forControlEvents:UIControlEventTouchUpInside];
anniView.rightCalloutAccessoryView=btn; 我做的是基于MapKit的应用,在地图里加上了很多大头针,然后点击大头针再打头阵的上面出现了一个注视图,在右边自己定义了一个按钮,点击按钮后,请问如何知道自己点击的按钮是哪一个
-(void)countup:(UIApplication *)application{
UIAlertView *alertstart = [[UIAlertView alloc]
initWithTitle:@"车站"//self.station.name
message:@"距离"
delegate:nil
cancelButtonTitle:@"back"
otherButtonTitles:nil];
[alertstart show];
[btn setFrame:CGRectMake(0, 0, 20, 20)];
[btn addTarget:self action:@selector(countup:) forControlEvents:UIControlEventTouchUpInside];
anniView.rightCalloutAccessoryView=btn; 我做的是基于MapKit的应用,在地图里加上了很多大头针,然后点击大头针再打头阵的上面出现了一个注视图,在右边自己定义了一个按钮,点击按钮后,请问如何知道自己点击的按钮是哪一个
-(void)countup:(UIApplication *)application{
UIAlertView *alertstart = [[UIAlertView alloc]
initWithTitle:@"车站"//self.station.name
message:@"距离"
delegate:nil
cancelButtonTitle:@"back"
otherButtonTitles:nil];
[alertstart show];
解决方案 »
- ios 怎样记录数据操作
- 新手发布应用到appstore的签名 问题 高分求大侠帮忙
- ios WebView打开本地html文件
- [PLLogging] ***** Error: logging directory does not exist /var/mobile/Library/Lo
- inhouse 发布成功之后下载失败
- ios 调用webserver 接口
- (急急急),可以通过APP读取到ios自带的日历信息吗?
- iphone6s 按钮点击轻轻的才有反应
- ios-scrollView 上面嵌套三个tableView(可横向切换),MJRefresh加上去看不到啊?或者有其他上拉加载,下拉刷新!
- iOS TabView的显示问题
- 同步和异步请求的问题
- 求助-IPAD 充电时,右上角,为什么会显现“没有充电”
我们可以发现:
- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);
- (void)mapView:(MKMapView *)mapView didDeselectAnnotationView:(MKAnnotationView *)view __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);这两个方法就选中与没选中时要调用的方法, 转进来的MKAnnotationView里有一个annotation属性,就是你所选中的MKAnnotation希望对你有用。
btn.tag = 1;
btn.tag = 2;
这样设置啊。