route-me marker label with UIButtonTypeDetailDisclosure-Button - Button isn't clickabel
Question
I've got a problem with the route-me framework and marker labels. I'm trying now about 5 hours with no luck and searched almost every forum topic on the web about this. I want to add a marker label with a UIButtonTypeDetailDisclosure-Button on it. When I add the Button to the UIView that should be the label I can't click on the Button.
My code is as follows:
- (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");
}
I hope anyone may help me with this. Thanks :)
I you need any more information please let me know!
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow