Rod
Rod

Reputation: 779

How to make an iPhone dropdown-looking button

I've seen a dropdown-like button on many apps, including Turf Wars, that simulates a dropdown with a picker. I need to use the same functionality in my app, but I'm not too sure what the best way to go about it may be.

Example:
Here's an example I found online.

I figured I could make two images and set them as a UIButtons background image for the different states and have the button open a pickerview.

Any input would be appreciated.

Rod

Upvotes: 4

Views: 9044

Answers (2)

Bishnu Pada Chanda
Bishnu Pada Chanda

Reputation: 5416

You can use a button with the image like dropdown image. And you can place a picker over that button hidden. In the click event you will show the picker. And after selection on picker you have to update the text value of the button and hide the picker again. Hope it helps you...

Upvotes: 7

Swastik
Swastik

Reputation: 2425

You can use a pop over that has picker in it.You can use use different images as UIButton background as you mentioned.It will give a feel of dropdown button.You can show popover on button action

Upvotes: 2

Related Questions