如何制作iPhone下拉式按钮 [英] How to make an iPhone dropdown-looking button
问题描述
我在很多应用程序上都看到过类似按钮的按钮,包括Turf Wars,它模拟了一个选择器的下拉列表。
我需要在我的应用程序中使用相同的功能,但我不太清楚最好的方法是什么。
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:
我想我可以制作两个图像,并将它们设置为不同状态的UIButtons背景图像,并让按钮打开一个选择器视图。
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.
任意输入将不胜感激。
Rod
推荐答案
您可以使用按钮与图像下拉图像。你可以在隐藏的按钮上放置一个选择器。在点击事件中,您将显示选择器。选择选择器后,您必须更新按钮的文本值并再次隐藏选择器。希望它可以帮助你...
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...
这篇关于如何制作iPhone下拉式按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!