Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d6bb828

Browse filesBrowse files
committed
Accept Pull Request #421 : (jwill:master -> coding:master)
Pull Request: fix ios7~ bar crash Created By: @jwill Accepted By: @王哼哼 URL: https://coding.net/u/coding/p/Coding-iOS/git/pull/421
2 parents cc83d4e + fa84ba8 commit d6bb828
Copy full SHA for d6bb828

File tree

Expand file treeCollapse file tree

1 file changed

+9
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-1
lines changed
Open diff view settings
Collapse file

‎Coding_iOS/Views/Search/CategorySearchBar.m‎

Copy file name to clipboardExpand all lines: Coding_iOS/Views/Search/CategorySearchBar.m
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,16 @@ @implementation CategorySearchBar
2020
-(void)layoutSubviews
2121
{
2222
self.autoresizesSubviews = YES;
23+
NSPredicate *finalPredicate = [NSPredicate predicateWithBlock:^BOOL(UIView *candidateView, NSDictionary *bindings) {
24+
if ([candidateView isMemberOfClass:NSClassFromString(@"UISearchBarTextField")]) {
25+
return true;
26+
}else{
27+
return false;
28+
}
29+
}];
30+
2331
//找到输入框 右移
24-
UITextField *searchField=[[[[self subviews] firstObject] subviews] lastObject];
32+
UITextField *searchField=[[[[[self subviews] firstObject] subviews] filteredArrayUsingPredicate:finalPredicate] lastObject];
2533
searchField.textAlignment=NSTextAlignmentLeft;
2634
[searchField setFrame:CGRectMake(53,4.8,self.frame.size.width-55,22)];
2735
//

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.