iphone - Custom annotation not showing callout -
iphone - Custom annotation not showing callout -
i getting weird stuff in custom mkannotaionview. when click on pin not show detail. making mistake?
here code:
- (mkannotationview *) mapview:(mkmapview *)mapview1 viewforannotation:(id <mkannotation>) annotation { mkpinannotationview *annotationview = [[mkpinannotationview alloc] initwithannotation:annotation reuseidentifier:@"redpin"]; annotationview.pincolor = mkpinannotationcolorred; annotationview.animatesdrop = yes; uibutton *button = [uibutton buttonwithtype:uibuttontypedetaildisclosure]; button.frame = cgrectmake(0, 0, 23, 23); annotationview.rightcalloutaccessoryview = button; // image , 2 labels uiview *leftcav = [[uiview alloc] initwithframe:cgrectmake(0,0,23,23)]; uilabel *label1 = [[uilabel alloc]init]; label1.text = [nsstring stringwithformat:@"hello"]; [leftcav addsubview :label1]; annotationview.leftcalloutaccessoryview = leftcav; annotationview.canshowcallout = yes; homecoming annotationview; }
iphone ios mkmapview
Comments
Post a Comment