国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > iOS > 正文

IOS開發代碼分享之設置UISearchBar的背景顏色

2020-07-26 03:36:21
字體:
來源:轉載
供稿:網友

今天用到UISearchBar,之前網上提供的方法已經不能有效的去除掉它的背景色了,修改背景色方法如下:

mySearchBar.backgroundColor = RGBACOLOR(249,249,249,1);    mySearchBar.backgroundImage = [self imageWithColor:[UIColor clearColor] size:mySearchBar.bounds.size]; //取消searchbar背景色- (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size{    CGRect rect = CGRectMake(0, 0, size.width, size.height);    UIGraphicsBeginImageContext(rect.size);    CGContextRef context = UIGraphicsGetCurrentContext();         CGContextSetFillColorWithColor(context, [color CGColor]);    CGContextFillRect(context, rect);         UIImage *image = UIGraphicsGetImageFromCurrentImageContext();    UIGraphicsEndImageContext();         return image;}

 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 武功县| 拉萨市| 资中县| 元朗区| 宝坻区| 牡丹江市| 四子王旗| 恩平市| 新津县| 阜新市| 长沙市| 周至县| 友谊县| 通河县| 始兴县| 海宁市| 鸡西市| 阿尔山市| 嘉黎县| 新密市| 灌云县| 越西县| 滁州市| 翁源县| 镇康县| 友谊县| 铁力市| 宜宾县| 进贤县| 侯马市| 寿光市| 青河县| 禄劝| 玉环县| 平利县| 西安市| 玉田县| 孟州市| 郁南县| 鱼台县| 台中市|