I use this code to add an insert to the image backIndicatorfor the navigation bar. However, this only works for vertical image positioning. I can only move the image up or down, but not left or right. It looks like the left / right insert is not working. I am not sure what could be the problem.
UIEdgeInsets insets = UIEdgeInsetsMake(0, 20, 0, 0);
UIImage *backArrowImage = [[UIImage imageNamed:@"Back"] imageWithAlignmentRectInsets:insets];
[[UINavigationBar appearance] setBackIndicatorImage:backArrowImage];
[[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:backArrowImage];
I also tried this:
UIImage * backArrowImage =[[UIImage imageNamed:@"Back"]resizableImageWithCapInsets:UIEdgeInsetsMake(0, 20, 0, 0) resizingMode:UIImageResizingModeStretch];
If this is not possible, do I need to return to adding a custom back button?
source
share