objective c - iOS - Adding gradient as background to all view controllers -
i set background view controllers gradient. currently, running in viewdidload():
cagradientlayer *gradient = [cagradientlayer layer]; gradient.frame = self.view.bounds; gradient.colors = [nsarray arraywithobjects:(id)[uicolorfromrgb(0x10425e) cgcolor], (id) [uicolorfromrgb(0x487f9d) cgcolor], nil]; [self.view.layer insertsublayer:gradient atindex:0];
how can view controllers without having put in every view controller's viewdidload()?
make uiviewcontroller subclass code, use base class view controllers.
Comments
Post a Comment