MapView 加载后如何为其设置动画?
有人可以帮我使用动画加载地图吗?我正在尝试加载 MapView。我希望它在视图加载后缩放到我的位置。我正在尝试这个:
- (void)viewDidAppear {
[super viewDidAppear:TRUE];
MKCoordinateRegion region;
CLLocationCoordinate2D location=secondMap.userLocation.coordinate;
MKCoordinateSpan span;
location.latitude=40.443242;
location.longitude=-79.94305;
region.span=span;
region.center=location;
[secondMap setRegion:region animated:TRUE];}
此代码似乎不起作用。当我尝试 viewDidLoad 时,位置已经在那里,我认为这是预期的。
谢谢。
Could someone please help me with loading maps using animation? I am trying to load a MapView. I want it to zoom to my place once the view loads. I am trying this:
- (void)viewDidAppear {
[super viewDidAppear:TRUE];
MKCoordinateRegion region;
CLLocationCoordinate2D location=secondMap.userLocation.coordinate;
MKCoordinateSpan span;
location.latitude=40.443242;
location.longitude=-79.94305;
region.span=span;
region.center=location;
[secondMap setRegion:region animated:TRUE];}
This code does not seem to work. When I tried, viewDidLoad, the location was already there, which I think is expected.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 viewDidAppear 函数缺少参数
your viewDidAppear function is missing parameter