2 Star 4 Fork 1

lfsoul2014 / CustomCalloutView

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

iOS版自定义CalloutView开源组件

###概述 本开源代码中包含MAMapSMCalloutView和CustomAnnotationView用于实现可自定的CalloutView;

使用教程

  • 在mapView:viewForAnnotation 中使用CustomAnnotationView作为MAAnnotationView;
- (MAAnnotationView *)mapView:(MAMapView *)mapView viewForAnnotation:(id<MAAnnotation>)annotation
{
    CustomAnnotationView *annotationview = (CustomAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"PinAnnotationsIdentifier"];
    
    if (annotationview == nil)
    {
        annotationview = [[CustomAnnotationView alloc] initWithAnnotation:annotation
                                                          reuseIdentifier:@"PinAnnotationsIdentifier"];
    }
    annotationview.canShowCallout = YES;
    annotationview.image          = [UIImage imageNamed:@"poi_yellow"];
    return annotationview;
}
  • 在mapView: didSelectAnnotationView:中 需要配置rightAccessoryView, calloutHeihgt,subviewClass,backgroundImage;
[mapView deselectAnnotation:view.annotation animated:NO];
_customCalloutView.rightAccessoryView = poiListView;
_customCalloutView.calloutHeight = 170;
_customCalloutView.subviewClass       = [UITableView class];
_customCalloutView.backgroundImage    = [UIImage imageNamed:@"map_bubble"];
[_customCalloutView presentCalloutFromRect:CGRectMake(view.bounds.origin.x,
                                                              view.bounds.origin.y,
                                                              view.bounds.size.width,
                                                              100)
                                            inView:view
                                 constrainedToView:self.view
                          permittedArrowDirections:MAMapSMCalloutArrowDirectionDown
                                          animated:YES];

空文件

简介

本开源代码中包含MAMapSMCalloutView和CustomAnnotationView用于实现可自定的CalloutView 展开 收起
Objective-C
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Objective-C
1
https://gitee.com/lfsoul2014/CustomCalloutView.git
git@gitee.com:lfsoul2014/CustomCalloutView.git
lfsoul2014
CustomCalloutView
CustomCalloutView
master

搜索帮助