MKMapView Change Red Pin Color

Ads
 

MKMapView Change Red Pin Color

MKMapView Change Pin Color

Hi, in my iphone map view application, i displayed the image on annotation instead of custom pin. But however on click it changes to red color pin. Can any one please tell me how can i show the same image ever after it's taped.

View Answers

February 12, 2011 at 12:18 PM

MKMapView changes to Red Pin on Tapping

This is a MKAnnotationView issue. Use MKAnnotationView instead of MKPinAnnotationView. And set the custom image. It will fix the problem.

or See the code below...

- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
{
//I think here you will be adding a annotation(my assumption)
[mapView addAnnotation:yourAnnotation];
//This will call viewForAnnotation again
}


- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
//If you didnt specify the a image for the annotation the default pin image will be assigned here..
}

Whenever we click on a annotation it call the delegate. So, you need to set your image into it.

Ads









Related Tutorials/Questions & Answers:
MKMapView Change Red Pin Color
MKMapView Change Red Pin Color  MKMapView Change Pin Color Hi... of custom pin. But however on click it changes to red color pin. Can any one please...;MKMapView changes to Red Pin on Tapping This is a MKAnnotationView issue. Use
change color according to the database value
change color according to the database value  any one know how to get values from database ( 1 or 0 ) and according to that change the color ( red or green) of given list
Advertisements
how to change color of titlebar in java
how to change color of titlebar in java  pls help
change navbar dropdown color in bootstrap
change navbar dropdown color in bootstrap  How to change the color of navbar dropdown color in a bootstrap based menu in a website? Thanks  ... .open .dropdown-menu { background-color: #9F0000; color:#ffffff; } Above
change color of back ground using switch
change color of back ground using switch   how to change back ground color according to day using switch case
to change the styleclass color of <apex:outputlabel > onclick button function in javascript
, then through javascript how can we change the color of outputlabel to red color .my { color: Black; font-size: 10px; font-family: Arial...to change the styleclass color of onclick button function in javascript 
How can I change UIButton title color?
How can I change UIButton title color?  Hi, I have a button in my iPhone/iPad application. I want to change the color of the text when user clicks..., You have to set the color of the button for a particular state say
How to change the color of a base64-encoded png image JQuery?
How to change the color of a base64-encoded png image JQuery?  I am going to change the colors of the pixels of a png image(which is in base64 format.... the original image is shown, but the color does not change. Do you know why
how to change div background color in javascript
how to change div background color in javascript  how to change div background color in javascript ?   <div id="Name">   <div class="content">      <h2>Your Name here</h2>       <p>First
How to change table row color when click on Hyper Link in jsp?
How to change table row color when click on Hyper Link in jsp?  I use... row2 row3.. when click on the link1 automatically change the the row1 color,similarly when click on the link2 automatically change the the row2
How to change color of opened Bootstrap drop down toggle?
How to change color of opened Bootstrap drop down toggle?  HI... to change the color of the same? Thanks   Hi, Following code works well... .navbar-nav .open .dropdown-menu { background-color: #9F0000; color
Change JPanel background color from mouse entered/exit event
Change JPanel background color from mouse entered/exit event  I have..."); and I got it to work that way but I couldn't get the tile JPanels to change color with setBackground(new Color());. Any suggestions would be greatly appreciated
Here is a set of 26 different shades of one of the most favourite Red colors
favourite Red colors rangeing from light Red color to darker Red color... .menuText1 { font:10pt bold Arial, Helvetica, sans-serif; color:#FFFFFF... bold Arial, Helvetica, sans-serif; color:#000000; text-align:left; padding
mkmapview zoom to current location
mkmapview zoom to current location  How can i zoom map to the current location
ModuleNotFoundError: No module named 'pin'
ModuleNotFoundError: No module named 'pin'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'pin' How to remove the ModuleNotFoundError: No module named 'pin' error
ModuleNotFoundError: No module named 'django-pin'
ModuleNotFoundError: No module named 'django-pin'  Hi, My Python... 'django-pin' How to remove the ModuleNotFoundError: No module named 'django-pin' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'ebs-pin'
ModuleNotFoundError: No module named 'ebs-pin'  Hi, My Python...-pin' How to remove the ModuleNotFoundError: No module named 'ebs-pin... to install padas library. You can install ebs-pin python with following command
ModuleNotFoundError: No module named 'flake8-exact-pin'
ModuleNotFoundError: No module named 'flake8-exact-pin'  Hi, My... named 'flake8-exact-pin' How to remove the ModuleNotFoundError: No module named 'flake8-exact-pin' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'pin_functions'
ModuleNotFoundError: No module named 'pin_functions'  Hi, My... 'pin_functions' How to remove the ModuleNotFoundError: No module named 'pin_functions' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'pin-py'
ModuleNotFoundError: No module named 'pin-py'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'pin-py' How to remove the ModuleNotFoundError: No module named 'pin-py'
ModuleNotFoundError: No module named 'rolling-pin'
ModuleNotFoundError: No module named 'rolling-pin'  Hi, My Python... 'rolling-pin' How to remove the ModuleNotFoundError: No module named 'rolling-pin' error? Thanks   Hi, In your python environment
div background color in html
div background color in html   How to change the background color of DIV in HTML
select the foreground color for a label
select the foreground color for a label  (Using JScrollBar) Write a program that uses scroll bars to select the foreground color for a label, Three horizontal scroll bars are used for selecting the red, green, and blue components
UIButton text color
UIButton text color  Hi, I have to change the text color of UIButton to black. Give me best code for changing UIButton text color to black. Thanks
ModuleNotFoundError: No module named 'django-pin-passcode'
ModuleNotFoundError: No module named 'django-pin-passcode'  Hi, My... named 'django-pin-passcode' How to remove the ModuleNotFoundError: No module named 'django-pin-passcode' error? Thanks   Hi
ModuleNotFoundError: No module named 'ipfs-pin-steem'
ModuleNotFoundError: No module named 'ipfs-pin-steem'  Hi, My... named 'ipfs-pin-steem' How to remove the ModuleNotFoundError: No module named 'ipfs-pin-steem' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'Pi-Pin-Manager'
ModuleNotFoundError: No module named 'Pi-Pin-Manager'  Hi, My... named 'Pi-Pin-Manager' How to remove the ModuleNotFoundError: No module named 'Pi-Pin-Manager' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'Progetto-One-Pin-Keypad'
ModuleNotFoundError: No module named 'Progetto-One-Pin-Keypad'  Hi...: No module named 'Progetto-One-Pin-Keypad' How to remove the ModuleNotFoundError: No module named 'Progetto-One-Pin-Keypad' error? Thanks   
ModuleNotFoundError: No module named 'red'
ModuleNotFoundError: No module named 'red'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'red' How to remove the ModuleNotFoundError: No module named 'red' error
Jbutton[] background & foregroundcolor change
Jbutton[] background & foregroundcolor change  how to change the color of the selected JButton in java swing. I am create JButton in an array... foreground and background color is changed. the remaining jbutton foreground
How to add UIImage on pin location MKMapKit
How to add UIImage on pin location MKMapKit  Hi, In my application, i need to add a custom image on MapView controller instead of pin. I am calling image through database "URL". Please suggest .. Thanks!   

Ads