【问题标题】:Change search bar scope background color更改搜索栏范围背景颜色
【发布时间】:2018-07-31 22:37:49
【问题描述】:

更改搜索栏范围(全部/待定)背景颜色

请参考下图

【问题讨论】:

标签: ios objective-c


【解决方案1】:

我有一个示例问题,我用下面的代码解决了这个问题。

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;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-02-18
    • 2020-12-17
    • 1970-01-01
    • 2018-02-06
    • 1970-01-01
    • 2013-10-10
    • 1970-01-01
    • 2016-07-24
    相关资源
    最近更新 更多