0
A
回答
1
你可能添加的蓝色按钮,这样的事情
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{
MKPinAnnotationView *annView=(MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"annViewIdentifier"];
if (annView == nil) {
annView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"annViewIdentifier"] autorelease];
}
UIButton *infoDefaultButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[infoDefaultButton addTarget:self
action:@selector(showDetails:)
forControlEvents:UIControlEventTouchUpInside];
annView.rightCalloutAccessoryView = infoDefaultButton;
}
,如果你想要的任何自定义按钮,那么你可以添加UIButtonTypeCustom
代替UIButtonTypeDetailDisclosure
并设置其框架。
相关问题
- 1. syntaxhighlighter如何更改注释的颜色
- 2. iOS更改引脚注释的颜色
- 3. ggplot2 - 注释 - 更改文本注释的背景颜色
- 4. VBA宏用于更改注释颜色
- 5. 更改注释文本颜色Wrangler
- 6. 图像/按钮上的iPhone SDK注释/标注泡沫按
- 7. iphone注释针和按钮
- 8. 如何更改Netbeans IDE 8.2中的注释颜色?
- 9. 如何更改Word中VSTO注释的文本背景颜色?
- 10. 如何更改intellij中CoffeeScript TODO注释的颜色?
- 11. 如何更改Visual Studio代码中的注释颜色?
- 12. 如何更改emacs lua-mode.el中的注释颜色?
- 13. 注释标注上的附件按钮
- 14. 如何更改disqus注释的背景颜色?
- 15. 如何更改默认的注释颜色VS2010
- 16. Xamarin.iOS:如何更改苹果地图上的注释针颜色
- 17. 如何将System.Drawing.Color从C#转换为Excel.ColorFormat?更改注释颜色
- 18. 标注注释上标注按钮的文字
- 19. 如何更改按钮的tabcontrol颜色?
- 20. 如何更改gridView的按钮颜色
- 21. 如何更改按钮的颜色?
- 22. 如何更改按钮的颜色
- 23. 如何更改UIActionsheet按钮的颜色?
- 24. 用python更改PDF中的突出显示注释的颜色
- 25. 更改vim中的注释的字体颜色
- 26. 更改颜色的按钮
- 27. 在JFreeChart中更改注释的颜色和线宽
- 28. 标准更改注释
- 29. 更改按钮标签颜色Sencha
- 30. 如何更改按钮颜色?
annView.image = [UIImage imageNamed:@“flag.png”]; \t \t annView.annotation = annotation; UIButton * rightButton = [UIButton buttonWithType:UIButtonTypeCustom]; \t NSInteger annotationValue = [self.annobjs indexOfObject:annotation]; rightButton.frame = CGRectMake(5,100,10,10); rightButton.tag = annotationValue; UIImage * greyImage = [UIImage imageNamed:@“arrow.png”]; [rightButton setBackgroundImage:grayImage forState:UIControlStateHighlighted]; [rightButton addTarget:self action:@selector(showDetails:)forControlEvents:UIControlEventTouchUpInside]; annView.rightCalloutAccessoryView = rightButton; – 2011-12-19 06:58:56
好的... CGRectMake(0,0,23,23);这是工作,但图像不显示在第一位。剩下的东西? – 2011-12-19 07:11:17
我刚刚做了像你说的,但我的按钮图像不显示。它只有在点击那个按钮的地方后才会显示。在弹出标题和子标题只能看到......有什么可以解决这个问题? – 2011-12-20 13:43:26