小编Jos*_*var的帖子

UINavigationBar 设置背景图像中心 swift..?

我将背景图像放置为:

self.navigationController.navigationBar.setBackgroundImage(image, forBarMetrics: .Default)
Run Code Online (Sandbox Code Playgroud)

但是,重复图像。不,我希望它被重复给我并把它放在中心......?

iphone xcode ios swift

2
推荐指数
1
解决办法
1070
查看次数

SwipeActions 在 tableView swift 5 xcode 13.4.1 中不起作用

我正在对我的表格视图进行 TrailingSwipe 但它不起作用。不调用该函数trailingSwipeActionsConfigurationForRowAt

尝试使用leadingSwipeActionsConfigurationForRowAt,如果它对我有用,但对TrailingSwipe不起作用

有效的是我拥有表视图的委托和数据源

代码

func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
        let delete = UIContextualAction(style: .normal, title: "delete2") {(action, view, completionHandler) in
            print("delete2 \(indexPath.row)")
        }
        let swipe = UISwipeActionsConfiguration(actions: [delete])
        return swipe
    }
Run Code Online (Sandbox Code Playgroud)

使用 Apple Mac M1 (MacBook Pro M1)

xcode ios swift swift5

2
推荐指数
1
解决办法
1496
查看次数

标签 统计

ios ×2

swift ×2

xcode ×2

iphone ×1

swift5 ×1