在iOS应用程序中设置选项/设置视图的正确方法是什么?
在iOS应用程序中设置选项/设置视图的正确方法是:在iOS应用程序中设置选项/设置视图的正确方法是什么?,ios,swift,uitableview,uicollectionview,comparison,Ios,Swift,Uitableview,Uicollectionview,Comparison,在iOS应用程序中设置选项/设置视图的正确方法是: 使用UITableView或UICollectionView 实现静态表示、绘制单元格、分隔符、自定义句柄点击等 你的方式 我需要的是加速该类型UI的视图创建 您可以与.actionSheet样式一起使用 示例: let alertController = UIAlertController(title: nil, message: "Action for location", preferredStyle: .actionSheet)
UITableView
或UICollectionView
.actionSheet
样式一起使用
示例:
let alertController = UIAlertController(title: nil, message: "Action for location", preferredStyle: .actionSheet)
alertController.addAction(
UIAlertAction(title: "One", style: .default) { action in
// option clicked
})
//add more actions
present(alertController, animated: true, completion: nil)
外观:
这是一种通用的,应该根据您的需要而定。您可能希望在应用程序中构建一个设置场景作为tableview,或者可能一个操作表就足以满足您的需要。这个问题是离题的-它取决于应用程序,主要是基于意见的。根据设计,这更多是最适合用户体验的事情。