Decorating iOS 12 and below UINavigationController Gradient Color by Creating an extension for UINavigationBar. Create a gradient layer and add it as the background of the navigation bar.
UIImage extension allows creating an image from CALayer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This function creates and returns a gradient image. Changing the startPoint and endPoint (currently horizontal) to change the gradient direction to apply on Navigation Controller.
Then add the following function for complete UINavigationBar Extensions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
the gradient shows vertically ... i need horizontally
ReplyDelete