首页 > 代码库 > UISearchBar 改变背景色

UISearchBar 改变背景色

    UIView *backView = [[UIViewalloc] initWithFrame:CGRectMake(0,0, _searchBar.size.width,_searchBar.size.height)];

    [backView setBackgroundColor:[UIColorcolorWithRed:248/255.0green:248/255.0blue:248/255.0alpha:1]];

    [_searchBarinsertSubview:backView atIndex:1];

UISearchBar 改变背景色