当前位置: 首页 > news >正文

手机网站定制 杭州/成免费crm软件有哪些优点

手机网站定制 杭州,成免费crm软件有哪些优点,电子商务公司网站怎么建,北京做网站优化的公司在做地图有关的程序时,我们经常需要用户在地图上指定位置我们再用大头针标记。 1、在viewDidLoad中添加我们要捕获的手势: UILongPressGestureRecognizer *lpress [[UILongPressGestureRecognizer alloc] initWithTarget:self action:selector(longPress…

在做地图有关的程序时,我们经常需要用户在地图上指定位置我们再用大头针标记。

1、在viewDidLoad中添加我们要捕获的手势:

UILongPressGestureRecognizer *lpress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
lpress.minimumPressDuration
= 0.5;//按0.5秒响应longPress方法
lpress.allowableMovement = 10.0;
[m_mapView addGestureRecognizer:lpress];
//m_mapView是MKMapView的实例
[lpress release];

2、实现要响应的longPress方法:

- (void)longPress:(UIGestureRecognizer*)gestureRecognizer
{
if (gestureRecognizer.state == UIGestureRecognizerStateEnded){
return;
}


//坐标转换
CGPoint touchPoint = [gestureRecognizer locationInView:m_mapView];
CLLocationCoordinate2D touchMapCoordinate
=
[m_mapView convertPoint:touchPoint toCoordinateFromView:m_mapView];



MKPointAnnotation
* pointAnnotation = nil;
pointAnnotation
= [[MKPointAnnotation alloc] init];
pointAnnotation.coordinate
= touchMapCoordinate;
pointAnnotation.title
= @"名字";

[m_mapView addAnnotation:m_pointAnnotation];

[pointAnnotation release];

}

3,响应MKMapView的代理方法:

- (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation
{

if ([annotation isKindOfClass:[MKUserLocation class]])
{
[self.navigationItem.rightBarButtonItem setEnabled:YES];
//导航栏右边回到当前位置的按钮可用
return nil;
}



static NSString* AnnotationIdentifier = @"AnnotationIdentifier";
MKPinAnnotationView
* customPinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:AnnotationIdentifier];

if (!customPinView) {
customPinView
= [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier] autorelease];

customPinView.pinColor
= MKPinAnnotationColorRe;//设置大头针的颜色
customPinView.animatesDrop = YES;
customPinView.canShowCallout
= YES;
customPinView.draggable
= YES;//可以拖动

//添加tips上的按钮
UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside];
customPinView.rightCalloutAccessoryView
= rightButton;
}
else{
customPinView.annotation
= annotation;
}
return customPinView;

}

4、实现showDetails方法:

- (void)showDetails:(UIButton*)sender
{

}
关于MKMapView的更多请参加apple的MapCallouts例子。

转载于:https://www.cnblogs.com/dark-angel/archive/2011/05/05/2037352.html

http://www.lbrq.cn/news/971083.html

相关文章:

  • 网络求职做阿姨哪个网站好/seo包年优化
  • 标志在线设计网站/广东seo
  • 响应式网站建设报价单/杭州seo教程
  • 网站开发代做/技能培训班有哪些课程
  • 实验报告设计方案/站长工具seo综合查询源码
  • 安阳网站建设哪里最好/软件测试培训
  • 网站建设网店名字/自助搭建平台
  • 网站群建设论文/seo优化招商
  • 网站换模板影响/朋友圈网络营销
  • 无锡网站制作 高端网站定制/地推放单平台
  • 大连网站建设蛇皮果/seo投放
  • 施工企业资质审查系统/北京百度seo工作室
  • 沈阳做企业网站/谷歌推广
  • 免费做公司网站/沧州seo公司
  • 整容医院网站建设目的/网络推广平台几大类
  • 在百度云上建设网站/网络营销顾问招聘
  • 在国内做av网站/南宁seo渠道哪家好
  • 做网站水晶头/国外友链买卖平台
  • 相亲网站如何做/游戏推广是什么工作
  • 网站怎么做丰富的tag标签页/百度推广怎么优化关键词的质量
  • 网站建设及运行情况介绍/搜狗站长推送工具
  • 嘉兴网站推广公司/百度推广登录手机版
  • 徐州市铜山新区建设局网站/垂直搜索引擎
  • 途牛的旅游网站是谁做的/企业策划咨询公司
  • 楚雄做网站建设的公司/网站优化排名易下拉效率
  • 怎么做一网站/网站搭建公司
  • 网站维护大概要多久/卖链接的网站
  • 建筑公司网站设计模板/网络营销的认识
  • 网站网络架构/全国新冠疫情最新消息
  • wordpress添加新php页面/seo教程 百度网盘
  • 人工智能之数学基础:神经网络之多样本矩阵参数求导
  • 信而泰×DeepSeek:AI推理引擎驱动网络智能诊断迈向 “自愈”时代
  • 消息中间件(Kafka VS RocketMQ)
  • OpenCV稠密光流估计的一个类cv::optflow::DenseRLOFOpticalFlow
  • Anspire Open暑期上新季 - 第二弹Anspire Browser Agent,开启云端自动化新纪元
  • LIN通信协议入门