Commit 31c5d5789eda70047f4426651de8eca00d0b57cd
1 parent
23de0a29
no message
Showing
1 changed file
with
22 additions
and
6 deletions
CNLiveScioLive/Pages/Home/高级搜索/Controller/CNLiveAdvancedSearchViewController.m
| ... | ... | @@ -58,12 +58,28 @@ |
| 58 | 58 | self.searchBar.barTintColor = [UIColor whiteColor]; |
| 59 | 59 | self.searchBar.searchBarStyle =UISearchBarStyleMinimal; |
| 60 | 60 | |
| 61 | - UITextField *searchField = [_searchBar valueForKey:@"_searchField"]; | |
| 62 | - searchField.layer.cornerRadius = 10.0f; | |
| 63 | - searchField.layer.borderColor = HEXCOLOR(0xC4C5C8).CGColor; | |
| 64 | - searchField.layer.borderWidth = 1; | |
| 65 | - searchField.font = [UIFont systemFontOfSize:13]; | |
| 66 | - [self.view addSubview:self.searchBar]; | |
| 61 | + NSString *version = [UIDevice currentDevice].systemVersion; | |
| 62 | + if (version.doubleValue >= 13.0) { | |
| 63 | + UITextField *searchField; | |
| 64 | + NSUInteger Views = [self.searchBar.subviews count]; | |
| 65 | + for(int i = 0; i < Views; i++) { | |
| 66 | + if([[self.searchBar.subviews objectAtIndex:i] isKindOfClass:[UITextField class]]) { | |
| 67 | + searchField = [self.searchBar.subviews objectAtIndex:i]; | |
| 68 | + } | |
| 69 | + } | |
| 70 | + searchField.layer.cornerRadius = 10.0f; | |
| 71 | + searchField.layer.borderColor = HEXCOLOR(0xC4C5C8).CGColor; | |
| 72 | + searchField.layer.borderWidth = 1; | |
| 73 | + searchField.font = [UIFont systemFontOfSize:13]; | |
| 74 | + [self.view addSubview:self.searchBar]; | |
| 75 | + } else { | |
| 76 | + UITextField *searchField = [self.searchBar valueForKey:@"_searchField"]; | |
| 77 | + searchField.layer.cornerRadius = 10.0f; | |
| 78 | + searchField.layer.borderColor = HEXCOLOR(0xC4C5C8).CGColor; | |
| 79 | + searchField.layer.borderWidth = 1; | |
| 80 | + searchField.font = [UIFont systemFontOfSize:13]; | |
| 81 | + [self.view addSubview:self.searchBar]; | |
| 82 | + } | |
| 67 | 83 | |
| 68 | 84 | self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 50, MainScreenWidth, MainScreenHeight - 50)]; |
| 69 | 85 | self.tableView.backgroundColor = HEXCOLOR(0xF7F6F6); | ... | ... |