ios - How do I display an arrow for MKPinAnnotationView.rightCalloutAccessoryView, like in Apple Maps? -


do initialize button image similar or there default values can use?

enter image description here

mkpinannotationview *newannotation = [[mkpinannotationview alloc] initwithannotation:annotation reuseidentifier:@"pinlocation"]; newannotation.animatesdrop = yes; newannotation.canshowcallout = yes; newannotation.rightcalloutaccessoryview = [uibutton buttonwithtype:uibuttontypedetaildisclosure]; 

you can show disclosure button following code:

- (mkannotationview *) mapview:(mkmapview *)mapview viewforannotation:(id <mkannotation>) annotation {        mkpinannotationview *newannotation = [[mkpinannotationview alloc]     initwithannotation:annotation reuseidentifier:@"pinlocation"];      newannotation.canshowcallout = yes;     newannotation.rightcalloutaccessoryview = [uibutton buttonwithtype:uibuttontypedetaildisclosure];   //for custom button  uiimage *btnimage = [uiimage imagenamed:@"arrow.png"]; uibutton *btn = [uibutton buttonwithtype:uibuttontypecustom]; [btn setimage:btnimage forstate:uicontrolstatenormal];    newannotation.rightcalloutaccessoryview = btn;  //try custom image on callout accessory view    newannotation.rightcalloutaccessoryview = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"arrow.png"]];      return newannotation; } 

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -