我可以更改 MKMapView 中 Google 徽标的位置吗?
我正在制作一个具有 MKMapView 的应用程序。我在 MKMapView 顶部有一个半透明的 UIToolbar。问题是谷歌标志位于其下方。有没有办法在 UIToolbar 上方(Y 方向,而不是 Z 方向)显示 Google 徽标,而不是下方?
I am making an app that has an MKMapView. I have a translucent UIToolbar on top of the MKMapView. The problem is that the Google logo is beneath it. Is there a way to show the Google logo above (in Y direction, not Z) the UIToolbar instead of beneath it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
唯一的方法是同时更改
MKMapView
的大小和MKCooperativeSpan
的大小,以补偿UIToolbar
占用的地图量。如果您的目标是能够在工具栏下方显示地图的某些部分,那么这是不可行的。The only way would be changing size of
MKMapView
in the same time withMKCoordinateSpan
that should compensate the amount of the map occupied byUIToolbar
. If you goal is to be able to display some portion of the map beneath the toolbar, it is not feasible.我也遇到了同样的问题,担心它是否会违反使用条款。正如@Black Frog 所建议的,您应该移动工具栏或调整地图视图的大小以显示 Google 徽标。尽管它使半透明工具栏变得毫无意义,但这比让您的应用程序可能被拒绝要好。
I had the same problem, worrying if it might violate terms of use. As @Black Frog recommended, you should move toolbar or resize the mapView to show Google logo. Though it makes translucent toolbar to be meaningless, it's better than making your app to be potentially rejected.
没有 Google API 可以移动徽标。您将需要移动工具栏。
There is no Google API to move the logo. You will need to move your toolbar.
这很棘手,但这是可能的。放大 MKMapView.frame,以便隐藏 Google 徽标。苹果会拒绝您的应用程序,因此您需要再次添加徽标。这可以通过徽标的 png 来完成(私信我,我可以将其发送给您)。 Apple 接受,您可以将此 png 放置在地图上任何您想要的位置。
It's tricky, but it is possible. Enlarge the MKMapView.frame, so the Google logo is hidden. Apple would reject your App, so you need to add the logo again. This can be done with a png of the logo (pm me, I can send it to you). You can place this png wherever you want on the map, Apple accepts.
是的,你可以。甚至还可以得到苹果的认可。
参见这里:
http://nachbaur.com/blog/dealing-with-mkmapviews-google-带有半透明工具栏的徽标
这里:
http://rogchap.com/2011/06/17/mkmapview-moving-the -谷歌徽标/
Yes, you can. And it can even get approved by apple too.
See here:
http://nachbaur.com/blog/dealing-with-mkmapviews-google-logo-with-translucent-toolbars
And here:
http://rogchap.com/2011/06/17/mkmapview-moving-the-google-logo/