我有一个 mapView (_mapView),它本身就是我的 viewController 的一个子视图,我想在获取很多引脚时添加一个 activityIndicator,但是我不能让它出现在 mapView 上方,谁能建议为什么不
UIActivityIndicatorView *activityIndicator = nil;
activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray] ;
CGRect frame = activityIndicator.frame;
frame.origin = CGPointMake(290, 12);
activityIndicator.frame = frame;
activityIndicator.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
activityIndicator.tag = 2;
[self._mapView addSubview:activityIndicator];
dataMarkers = [[kepnService new] getPlacesByBounds:neCoord.latitude :neCoord.longitude :swCoord.latitude :swCoord.longitude]; // call to webservice
.... other processing code
[activityIndicator removeFromSuperview];
有关信息,我的视图堆栈如下所示
subviews (
"<MKMapView: 0x6d6f320; frame = (0 0; 320 460); clipsToBounds = YES; layer = <CALayer: 0x6d99520>>",
"<UIToolbar: 0x6d93f70; frame = (-1 0; 342 44); autoresize = W+TM; layer = <CALayer: 0x6d8bbf0>>",
"<UINavigationBar: 0x6d9a4f0; frame = (0 416; 320 44); autoresize = W+BM; layer = <CALayer: 0x6d9a5b0>>"
)