我有一个使用MKMapView作为主要显示区域的应用程序.这应始终朝北向上.但是快速无意的滑动并且它会旋转,导致指南针出现.
有没有办法阻止这种情况发生并保持视图锁定在北方?我在这里看到了一些提示,但没有任何内容涉及任何类型的内置机制.
解决方法
快速浏览Apple关于MKMapView的文档:
rotateEnabled A Boolean value indicating whether the map camera’s
heading information is used.@property(nonatomic,getter=isRotateEnabled) BOOL rotateEnabled
Discussion When this property is set to YES and a valid camera is
associated with the map,the camera’s heading angle is used to rotate
the plane of the map around its center point. When this property is
set to NO,the camera’s heading angle is ignored and the map is always
oriented so that true north is situated at the top of the map view.
因此,您可以尝试将mapview rotateEnabled属性设置为’NO’.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。