xcode 如何构建类似 iOS 的设置模块?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5338390/
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-14 20:32:58  来源:igfitidea点击:

How to build an iOS like settings module?

iphonexcodeinterface-builderinappsettingskit

提问by Upvote

I am really new to iPhone development. Currentlly I am setting up an option module for my application. The user should be able to edit some preferences.

我对 iPhone 开发真的很陌生。目前,我正在为我的应用程序设置一个选项模块。用户应该能够编辑一些首选项。

My first approach was to have some text fields. But I really like how iOS handles editing preferences. There is some kind of label. Clicking on that label opens another view with a field for editing. I hope you understand what I mean.

我的第一种方法是有一些文本字段。但我真的很喜欢 iOS 处理编辑首选项的方式。有某种标签。单击该标签会打开另一个带有编辑字段的视图。我希望你明白我的意思。

How does iOS achieve this? Is that table view?

iOS 是如何做到这一点的?那是表格视图吗?

I mean this kind of design

我是说这种设计

enter image description here

在此处输入图片说明

回答by gnuchu

InAppSettingsKit as already recommended by @hennes is used for extending functionality that is already available.

@hennes 已经推荐的 InAppSettingsKit 用于扩展已经可用的功能。

If you add a Settings.bundle to your app then if it is correctly installed it will automatically show up in the Settings.app provided by Apple.

如果您将 Settings.bundle 添加到您的应用程序,那么如果它安装正确,它将自动显示在 Apple 提供的 Settings.app 中。

回答by IshaanGandhi

IF you want it just in your app, just use a tableView set to Group style. There are a lot of tutorials on TableViews

如果您只想在您的应用程序中使用它,只需使用设置为组样式的 tableView。TableViews有很多教程

回答by hennes

You might want to try InAppSettingsKit.

您可能想尝试InAppSettingsKit

回答by Bruno Wernimont

There is another option, you can use BaseKit (I'm the author)

还有另一种选择,您可以使用 BaseKit(我是作者)

Source repo https://github.com/brunow/BaseKitExample of settings http://blog.brunowernimont.be/2012/06/22/example_of_settings_controller_with_basekit.html

源代码仓库https://github.com/brunow/BaseKit设置示例http://blog.brunowernimont.be/2012/06/22/example_of_settings_controller_with_basekit.html