uitableviewrowaction

Custom table view row action (image)

烂漫一生 提交于 2019-11-30 20:41:25
问题 My app includes an UITableView. It's cells has the option to display more than one line. The cells has also a custom row action (image). I set the row action image like this: let date = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title: "", handler: { (action, indexPath) -> Void in}) date.backgroundColor = UIColor(patternImage: UIImage(named: "rowActionPic")!) The image has has an 122x94 resolution. If the cell displays one line, all fits perfect. If the cell displays 2 or

How to do custom font and color in UITableViewRowAction without Storyboard

旧巷老猫 提交于 2019-11-30 06:57:37
I have classic TableView where you can delete item if you swipe and than clicking on the button. I know how to set custom background on the cell, but I can't find how I can set custom font and color for that. Thank you for help! func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]? { var deleteAction = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title: "Delete", handler: { (action:UITableViewRowAction!, indexPath:NSIndexPath!) -> Void in println("Delete button clicked!") }) deleteAction.backgroundColor = UIColor.redColor(

How to do custom font and color in UITableViewRowAction without Storyboard

我怕爱的太早我们不能终老 提交于 2019-11-29 08:11:49
问题 I have classic TableView where you can delete item if you swipe and than clicking on the button. I know how to set custom background on the cell, but I can't find how I can set custom font and color for that. Thank you for help! func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]? { var deleteAction = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title: "Delete", handler: { (action:UITableViewRowAction!, indexPath

UITableViewRowAction image for title

笑着哭i 提交于 2019-11-27 11:48:30
I made a custom UITableViewRowAction. Now I'd like to add an image instead of the text. I know that it's possible but don't know how to do it. Does someone of you knows how to do this in Swift and would like to help me? Thanks for your answers! iOS 11.0 Swift Apple introduced flexible way to declare row actions with great benefits. extension ViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { let askAction = UIContextualAction(style: .normal, title: nil) { action, view,

How to change UITableViewRowAction title color?

浪子不回头ぞ 提交于 2019-11-27 07:53:37
Am using UITableViewRowAction in "editActionsForRowAtIndexPath" method. I can change the backgroundcolor of UITableViewRowAction, but am not able to change the title color. But I would like to change the color of the UITableViewRowAction. Any inputs on this regard will be appreciable. I'm afraid that there's no way to change the title color of the UITableViewRowAction. The only things you can change on the action are: backgroundColor style (destructive (red backgroundcolor, ...) title For more info, please refer to the Apple Doc UITableViewRowAction There is one way that can achieve what you

UITableViewRowAction image for title

早过忘川 提交于 2019-11-26 15:46:06
问题 I made a custom UITableViewRowAction. Now I'd like to add an image instead of the text. I know that it's possible but don't know how to do it. Does someone of you knows how to do this in Swift and would like to help me? Thanks for your answers! 回答1: iOS 11.0 Swift Apple introduced flexible way to declare row actions with great benefits. extension ViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) ->

How to change UITableViewRowAction title color?

北慕城南 提交于 2019-11-26 13:52:32
问题 Am using UITableViewRowAction in "editActionsForRowAtIndexPath" method. I can change the backgroundcolor of UITableViewRowAction, but am not able to change the title color. But I would like to change the color of the UITableViewRowAction. Any inputs on this regard will be appreciable. 回答1: I'm afraid that there's no way to change the title color of the UITableViewRowAction. The only things you can change on the action are: backgroundColor style (destructive (red backgroundcolor, ...) title