Maps page curl button custom implementation highlighted
I've been trying to get this the same as the maps app icon for map options but no success. I was trying to make the map curl button in the right corner of the UIToolBar. I couldn't get the button that comes in the SDK to follow the colouring so I had to create my own similar looking button.
To add this to the tool bar I create a custom button with the image for UIControlStateNormal, Create the UIBarButtonItem with a cust开发者_StackOverflow中文版omView as the pageFlip button.
This works fine but I need to keep it highlighted when the user touches it (and then return back to normal after the user is finished). When the user touches it currently it does become shaded but I've tried setting [button setSelected:YES];
and no dice. I've tried setting the different states of the button to the current image but this doesn't work either. I assume I could create a highlighted image for the button to set but thats a lot of time for something that really seems simple.
Any thoughts I could try?
To make a UIBarButtonItem blue, it must have the "Done" style. You cant change the style of a button at run-time so the only alternative left is to replace the contents of the toolbar with new buttons. Fortunately, you can specify that it must be animated.
I know what you're thinking. It's pretty bad.
精彩评论