开发者

Move Google Maps logo when using in a iPhone app

I wonder if it's p开发者_C百科ossible to move the Google logo that shows at the bottom left corner of every MKMapView object that is used in a iPhone app.

I don't want to make it disappear, just move it, for example, to the bottom right corner. Any thoughts on this?

Thanks!


Although there is no direct API to manipulate the logo, you can still implement a workaround. The Google logo is the second view in the map view's collection of child views. Here is pseudocode in your MapViewController class:

// Get logo image view   
UIImageView* imageView = [self.mapView.subviews objectAtIndex:1];
// Get the actual image
UIImage* googleLogo = [imageView image];
// Declare your own image view (googleMapsLogo) to host the logo
// and put it onto map view at the desired position
// Assign to Google logo image to it
self.googleMapsLogo.image = googleLogo;
// Hide the original Google logo
imageView.hidden = YES;

If you need to dynamically position the logo, you can do so by changing googleMapsLogo.center property. Alternatively, you can try to re-position the original logo's image view.


It is not possible with the available APIs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜