MapKit框架

来源:互联网 发布:手机桌面软件插件 编辑:程序博客网 时间:2024/05/20 23:32

显示地图的视图称为MKMapView。该类包含很多功能,包括如何显示地图、注释和用户位置。使用MKMapView需要导入MapKit.framework框架,在头文件中导入<MapKit/MapKit.h>,同时还需要遵循MKMapViewDelegate委托协议。


1、添加地图

MKMapView  *map = [[MKMapView alloc] initWithFrame:CGRectMake(0,0,320,480)];

map.delegate = self;  //将他的委托设为自己的类

[self .view addSubView:map];


原创粉丝点击