使用 XCode 向 iPhone 应用程序添加复选框(或类似)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11786334/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:07:35  来源:igfitidea点击:

Add a checkbox (or similar) to iPhone app using XCode

iphonexcodebuttoninterfacestoryboard

提问by ingenspor

I notice in Objects Library when I'm in editor, there are checkboxes. But they disappear when I go to the storyboard. So is there a way to add a chechbox in iPhone interface or are they meant for other platform? If it's not possible, is there something else that could do the same job? I'm making a search function and I want a criteria to be added in the search if the chechbox is checked, that's why I need something like that. Thanks.

当我在编辑器中时,我注意到对象库中有复选框。但是当我转到故事板时它们消失了。那么有没有办法在 iPhone 界面中添加一个 chechbox 或者它们是否适用于其他平台?如果不可能,是否还有其他东西可以做同样的工作?我正在制作一个搜索功能,如果选中了 chechbox,我希望在搜索中添加一个条件,这就是为什么我需要类似的东西。谢谢。

回答by Jim

Checkboxes are for OS X. The iOS equivalents are switches. If they aren't appropriate, you can roll your own checkbox using buttons.

复选框用于 OS X。iOS 等效项是开关。如果它们不合适,您可以使用按钮滚动您自己的复选框。