【发布时间】:2011-05-11 16:58:45
【问题描述】:
我的 route-me 框架和标记标签有问题。我现在尝试了大约 5 个小时,但没有运气,并在网上搜索了几乎所有关于此的论坛主题。 我想添加一个带有 UIButtonTypeDetailDisclosure-Button 的标记标签。 当我将 Button 添加到应该是标签的 UIView 时,我无法单击 Button。
我的代码如下:
- (void)tapOnMarker:(RMMarker*)marker onMap:(RMMapView*)map {
UIView *frame = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
UIButton *button = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
button.frame = CGRectMake(0, 0, 34, 34);
button.enabled = YES;
button.userInteractionEnabled = YES;
[button addTarget:self action:@selector(markerLabelButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
[frame addSubview:button];
[marker setLabel:frame];
[marker showLabel];
}
-(void)markerLabelButtonPressed:(id)sender {
NSLog(@"pressed");
}
我希望有人可以帮助我。谢谢:)
如果您需要更多信息,请告诉我!
【问题讨论】:
-
我刚刚为此提交了一个拉取请求。 github.com/route-me/route-me/pull/161
-
我正在尝试在我的项目中实现 Thins,您必须遵守什么委托才能使用 ontapmarker 方法?
标签: iphone uiview uibutton marker route-me