Stanislav K. Asked:2020-05-17 23:59:26 +0800 CST2020-05-17 23:59:26 +0800 CST 2020-05-17 23:59:26 +0800 CST 编辑表格时带有按钮的附加面板,例如 iOS 上的消息 772 我搜索了整个互联网,但没有找到答案;在编辑列表时的消息中,会出现一个带有按钮的附加面板,请参见图片。 我不明白,这是 UITableView 的原生功能吗?(可能不是)或者它是位于表格顶部的单独视图?告诉我,至少我在朝正确的方向挖掘。我用 Swift 做所有事情。 ios 1 个回答 Voted Best Answer Vitaly Potlov 2020-05-18T20:44:30+08:002020-05-18T20:44:30+08:00 尝试使用UIToolbar let toolbar = UIToolbar(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 50)) toolbar.barStyle = UIBarStyle.default toolbar.items = [ UIBarButtonItem(title: "Отмена", style: UIBarButtonItemStyle.plain, target: self, action: #selector(cancelAction)), UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.flexibleSpace, target: nil, action: nil), UIBarButtonItem(title: "Далее", style: UIBarButtonItemStyle.plain, target: self, action: #selector(nextAction))] toolbar.sizeToFit() 表演用 view.addSubview(toolbar) 为了隐藏 toolbar.removeFromSuperView
尝试使用
UIToolbar
表演用
为了隐藏