gpt4 book ai didi

ios - UITableView 中的 UIPickerView

转载 作者:IT王子 更新时间:2023-10-29 08:18:14 25 4
gpt4 key购买 nike

首先:我知道已经有人发布过这样的话题,但是所有这些话题都没有人给出明确的答案。

我的应用程序中有一个 settings-UITableView。现在我想添加一个 TableViewCell,我可以在其中使用 UIPickerView 在一些数字之间进行选择。

在 tableView didSelectRowAtIndexPath 方法中,我为正确的单元格创建了 if 语句

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

if (indexPath.row == 1){

}
}

如何为这个单元格添加一个 UIPickerView?它应该从底部向上滑动,如果有类似“完成”按钮的东西就好了。

最佳答案

你看过iOS 7发布的样例程序DateCell吗? ?它使用 UIDatePicker,但我发现将它调整为常规 UIPickerView 非常简单。

它完全符合您的描述:使用直接在您正在编辑的行下方打开的选择器编辑 UITableViewCell。

关于ios - UITableView 中的 UIPickerView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19646822/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com