【发布时间】:2018-07-31 22:37:49
【问题描述】:
【问题讨论】:
标签: ios objective-c
【问题讨论】:
标签: ios objective-c
我有一个示例问题,我用下面的代码解决了这个问题。
CGSize imageSize = CGSizeMake(64, 64);
UIColor *fillColor = [UIColor whiteColor];
UIGraphicsBeginImageContextWithOptions(imageSize, YES, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
[fillColor setFill];
CGContextFillRect(context, CGRectMake(0, 0, imageSize.width, imageSize.height));
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
self.searchController.searchBar.scopeBarBackgroundImage = image;
【讨论】: