简体   繁体   English

方向更改时MapView出现问题

[英]Problems with MapView when orientation changes

I have a MapView which autoresizes correctly when the orientation of the iPad changes. 我有一个MapView,当iPad的方向改变时,它会自动正确调整大小。 However the right 1/4 of the MapView shows a grey grid when I rotate to landscape. 但是,当我旋转到风景时,MapView的右1/4会显示灰色网格。 This part of the map won't load until it is touched or zoomed. 在触摸或缩放地图之前,这部分地图不会加载。 Any ideas what I'm doing wrong? 有什么想法我做错了吗?

Thanks 谢谢

Do you mean rotating mapview on big mapview region spans (like on image )? 您是说要在较大的mapview区域跨度上旋转mapview(如在image上 )吗? If yes, try to center map on 0.0f, 0.0f coordinates or make displayed region a bit smaller. 如果是,请尝试将地图以0.0f,0.0f坐标为中心,或将显示的区域缩小一些。 It seems that grey grid located on right might contains part of map, that actually should be shown on the very left, but for some reason map layer don't change it's position on MapView. 似乎位于右侧的灰色网格可能包含地图的一部分,实际上应该显示在地图的最左侧,但是由于某些原因,地图图层不会更改其在MapView上的位置。

Anyway, try to implement - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation in your view controller containing mapview and play a bit with mapview region. 无论如何,尝试在包含mapview的视图控制器中实现- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation并使用mapview区域进行播放。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM