2
搜索欄的刪除背景我已經使用這個代碼刪除後面搜索欄的背景,但是當我將視圖旋轉爲橫向或啓動橫向視圖的應用程序中的黑色容器周圍搜索欄iphone:當界面改變
for (UIView *searchSubview in mySearchBar.subviews) {
NSLog(@"Subview: %@", searchSubview);
if ([searchSubview isKindOfClass:NSClassFromString(@"UISearchBarBackground")]) {
//[searchSubview removeFromSuperview];
[searchSubview setAlpha:0.0];
//[searchSubview setBackgroundColor:[UIColor clearColor]];
//break;
}
}
顯示請在這方面給我啓發。我試圖在willRotate,shouldRotate和didRotate方法中實現此代碼,但問題仍然存在。請在這方面給我啓發。
問候 ANKIT