iPhone UIActionSheet with UISwitch and UITextField

柔情痞子 提交于 2019-12-11 01:28:30

问题


I'm just looking for advice with this as I have no idea where to start but I think a UIActionSheet is probably best.

What I'd like to have is a pop up window (in my head I picture it as being translucent and dark gray). It will not take up the whole screen and the view underneath will still be visible.

In the pop up section there will be a textfield (with several lines) and underneath this there will be a number of UISwitches.

The pop up will be scrollable and will end with OK/Cancel buttons at the bottom.

Like I said, I really have no idea where to start with this but any advice is more than welcome!


回答1:


A UIActionSheet is probably not what you are after in this case (although you may want a similar look and feel). Think of an action sheet as a traditional modal OK/cancel/Yes/No type dialog box:

Use the UIActionSheet class to present the user with a set of alternatives for how to proceed with a given task.

From the sound it of it, you need to create a UIView in InterfaceBuilder with a semi-transparent background and various child controls (UISwitches and UITextFields). You create your view using the XIB you have configured and add it as a subview of your UIViewController's view. If you want to mimic the animation you get from an action sheet, you can do that with an AnimationBlock.



来源:https://stackoverflow.com/questions/3654091/iphone-uiactionsheet-with-uiswitch-and-uitextfield

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!