开发者

setShowsUserLocation property - why does this not work?

In an exercise I am doing involving MKMapView, I was instructed to enter the following line in application:didFinishLaunchingWithOptions: :

[mapView setShowsUserLocation:YES];

I expected this to zoom me into my location, but it did not.

Af开发者_Go百科ter carefully reviewing the MapView in Interface Builder, I noticed in the Attributes window a checkbox to toggle "Shows User Location". Suddenly the zoom worked. I commented out the other line and it still works, which begs the question - why did it fail in the first place?

I'm using the latest iPhone SDK.


That doesn't zoom to the location, it only tells the mapview to display the small blue dot. You'll have to move the mapview there yourself.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜