我正在尝试为 iOS 11 及更高版本制作可滑动的表格视图单元格,并尝试使用TrailingSwipeActionsConfigurationForRowAt但它适用于 iPad,但不适用于 iPhone。
iPhone 中不调用它。
令人惊讶的是,如果我尝试滑动手机超过 10 或 20 次,有时它会起作用一次。
这是我的控制器的表视图扩展
import UIKit
extension CustomViewController: UITableViewDelegate, UITableViewDataSource {
func initTableView() {
tableView.register(cell: SingleLineListItemViewCell.self)
tableView.delegate = self
tableView.dataSource = self
tableView.estimatedRowHeight = 64
tableView.rowHeight = UITableView.automaticDimension
tableView.backgroundColor = .green
tableView.isEditing = false
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let model = SingleLineListItemViewModel(title: "coko")
let cell = tableView.dequeueReusableCell(withIdentifier: SingleLineListItemViewCell.reuseIdentifier) …Run Code Online (Sandbox Code Playgroud) 如果在html字符串中写入"Card.io",则UIWebview会在下面的字符串中将其显示为带下划线的文本.
<p>
<strong>Card.io</strong>
<br />The MIT License (MIT)<br />
Copyright (c) 2013-2016 PayPal Holdings, Inc.<br />
Permission is hereby granted, ...<br />
The above copyright notice ...<br />
THE SOFTWARE IS PROVIDED "AS IS" ... <br />...
......
</p>
Run Code Online (Sandbox Code Playgroud)
如果写入"Hello World"而不是"Card.io",则UIWebview将其显示为粗体,但不会按预期加下划线.
<p>
<strong>Hello World</strong>
<br />The MIT License (MIT)<br />
Copyright (c) 2013-2016 PayPal Holdings, Inc.<br />
Permission is hereby granted, ...<br />
The above copyright notice ...<br />
THE SOFTWARE IS PROVIDED "AS IS" ... <br />...
......
</p> …Run Code Online (Sandbox Code Playgroud)