小编ond*_*rol的帖子

TrailingSwipeActionsConfigurationForRowAt 不稳定

我正在尝试为 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)

uitableview ios swift

3
推荐指数
1
解决办法
5290
查看次数

UIWebView神奇地强调某种文本

如果在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)

uiwebview ios

0
推荐指数
1
解决办法
135
查看次数

标签 统计

ios ×2

swift ×1

uitableview ×1

uiwebview ×1