我正在尝试在UIContextualAction中添加图片,请参阅以下代码: -
func tableView(_ tableView: UITableView,
trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration?
{
// Write action code for the Flag
let FlagAction = UIContextualAction(style: .normal, title: "View", handler: { (ac:UIContextualAction, view:UIView, success:(Bool) -> Void) in
print("Update action ...")
success(true)
})
FlagAction.image = UIImage(named: "flag")
return UISwipeActionsConfiguration(actions: [FlagAction])
}
图片,我正在使用
答案 0 :(得分:0)
答案 1 :(得分:0)
$queryscripts = mysqli_query($link,
"SELECT * FROM schedule
JOIN rooms
ON schedule.Rooms_idRooms = rooms.idRooms
ORDER BY schedule.startSched DESC")
or die("Please Try again later!");
仅接受模板图像,该模板使用不同的透明度来定义图像的形状和颜色。
答案 2 :(得分:0)
嗨,对我来说很好,
该图像大小将根据图像像素自动调整。
private func searchBarCode(forRowAt indexPath: IndexPath) -> UIContextualAction {
let context = UIContextualAction(style: .destructive, title: "") { (action, swipeButtonView, completion) in
completion(true)
}
context.backgroundColor = UIColor.white
context.image = UIImage(named: "document")
return context
}