uicontextualaction

Set custom font for UITableView swipe action (UIContextualAction)

余生颓废 提交于 2020-05-28 04:42:19
问题 How do you set a custom font for the title in UIContextualAction ? I have tried UIAppearance but without any luck... Cheers! :) 回答1: I have found a way to do this by using the image property instead of the title... Standard font (Remove/Rename) Custom font (Remove/Rename) To create an image of a label I have this extension: extension UIImage { /// This method creates an image of a view convenience init?(view: UIView) { // Based on https://stackoverflow.com/a/41288197/1118398 let renderer =

Is there a recommended image size for UIContextualAction icons?

隐身守侯 提交于 2020-01-13 13:11:38
问题 New in iOS 11, UIContextualAction provides a convenient way to implement swipe actions on UITableView cells, with a title and/or image icon. I haven't found any mention in the Human Interface Guidelines of the image used by UIContextualAction. Does any information exist that defines a standard size or other design guidance for this icon image? I tried to figure this out by testing a few image sizes to see if iOS would scale it to a consistent size, but it seems to just display whatever you

iOS TableView swipe UIContextualAction can not get a right image

你。 提交于 2019-12-13 03:34:32
问题 I want to set a image in the left swipe of cell, there is the code, but It doesn't work. - (UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath { if (@available (iOS 11, *)) { UIContextualAction *deleteAction = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"删除" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull

Is there a recommended image size for UIContextualAction icons?

谁都会走 提交于 2019-12-06 10:02:11
New in iOS 11, UIContextualAction provides a convenient way to implement swipe actions on UITableView cells, with a title and/or image icon. I haven't found any mention in the Human Interface Guidelines of the image used by UIContextualAction. Does any information exist that defines a standard size or other design guidance for this icon image? I tried to figure this out by testing a few image sizes to see if iOS would scale it to a consistent size, but it seems to just display whatever you give it with no scaling or cropping, so that didn't provide any clues. matt I use 30 by 30. You can