//网上大多数写法都是这样,但是不行
[_mapView.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if ([obj isKindOfClass:[UIImageView class]]) {
UIImageView * logoM = obj;logoM.layer.contents = (__bridge id)[UIImage imageNamed:@\"\"].CGImage;
// logoM.layer.contents = (__bridge id)[UIImage imageWithColor:[UIColor clearColor]].CGImage;
// logoM.hidden = YES;
}
}];
//用这个可以,,
for (UIView *view in _mapView.subviews) {
if ([view isKindOfClass:[UIImageView class]]) {
[view removeFromSuperview];
}
}