2014-05-19 2 views
3

내 앱에서 사용자 정의 UIViewUISearchBar을 사용하고 있습니다.iOS 7.1에서 UISearchBar barTintColor가 숨어 있지 않습니다.

다음은 UISearchBar을 표시하는 코드입니다.

searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(50, 135, 230, 32)]; 
searchBar.barTintColor = [UIColor clearColor]; 
searchBar.placeholder = @"Search"; 
[self addSubview:searchBar]; 

아이폰 OS 7.0.3에서 bartint 색상

enter image description here

그러나 아이폰 OS 7.1
에 표시되지는 bartint 색상이 숨어되지 않습니다.

enter image description here

+1

무엇을합니까 ['backGroundImage'] (https://developer.apple.com/library/ios/documentation/uikit/reference /UISearchBar_Class/Reference.html#//apple_ref/occ/instp/UISearchBar/backgroundImage)? 아니면 [this] (http://stackoverflow.com/a/12598711/1971013) 도움이됩니까? –

+0

예. [searchBar setBackgroundImage : [UIImage new]]; 속임수를한다! !!! –

답변

10

그것은이 트릭 않는 것 같습니다 :

[searchBar setBackgroundImage:[UIImage new]]; 
관련 문제