问题
MKMapview have legal link on its bottomright point. I want to add a button on this place. the button have some kind of transparency. can I hide the legal link? Or if i set my buttons in a way that hide this link may apple reject my app?
I also have some kinds of subviews in my map view.
回答1:
You SHOULD NOT hide this legal link or your app will be rejected by Apple.
EDIT : I've found a category wich allows you to move this link, I'm not the author : https://github.com/bartvandendriessche/MKMapView-AttributionView
回答2:
Try to use this one but i don't know apple will approve or not.
[[self.mapView.subviews objectAtIndex:1] removeFromSuperview];
回答3:
Removing the label will probably lead to your app getting rejected. However it can be done like this with swift:
var legalLabel: UIView?
for subview in stableMapView.subviews {
if String(describing: type(of: subview)) == "MKAttributionLabel" {
legalLabel = subview
}
}
legalLabel?.isHidden = true
回答4:
More safe version:
extension MKMapView {
var attributedView: UIView? {
for subview in subviews {
if String(describing: type(of: subview)).contains("Label") {
return subview
}
}
return nil
}
func hideAttributedView() {
guard let attributedView = attributedView else {
return
}
attributedView.isHidden = true
}
}
回答5:
Easiest way to hide the apple logo and legal text in the map (MapView).
To hide the apple logo in the map.
mapView.subviews[1].isHidden = true
To hide the legal text
mapView.subviews[2].isHidden = true
来源:https://stackoverflow.com/questions/16149395/how-can-hide-legal-link-of-the-mkmapview-monotouch-iphone