我习惯UIAlertViews
通过[ alert setValue:someView forKey:@"accessoryView"]
方法来定制.这为UIAlertViews创建了具有自定义高度的可自定义内容.但它只适用于iOS7及以下版本.在iOS8中UIAlertController
已经接管了,我不能再自定义它了,它会削减它的高度UIAlertView
.
是不是因为误用了UIAlertController
,或者我该怎么做呢?我试图在UIAlertController中包含一个UITableView UIAlertControllerStyleAlert
.
谢谢.
我在我的iOS应用程序中有一个普通的地图,其中"显示用户位置"已启用 - 这意味着我在地图上有我的正常蓝点,显示我的位置和准确度信息.标注在代码中被禁用.
但我也有定制的MKAnnotationViews,它们在地图上绘制,所有这些都有自定义标注.
这工作正常,但问题是当我的位置在MKAnnotationView的位置时,蓝点(MKUserLocation)拦截触摸,因此MKAnnotationView不会被触及.
如何禁用蓝点上的用户交互,以便MKAnnotationViews而不是蓝点拦截触摸?
这就是我到目前为止所做的事情:
- (MKAnnotationView *)mapView:(MKMapView *)map viewForAnnotation:(id <MKAnnotation>)annotation;
{
if (annotation == self.mapView.userLocation)
{
[self.mapView viewForAnnotation:annotation].canShowCallout = NO;
return [self.mapView viewForAnnotation:annotation];
} else {
...
}
}
Run Code Online (Sandbox Code Playgroud)