Skip to content

Commit

Permalink
fix crashed on iOS7, 8
Browse files Browse the repository at this point in the history
  • Loading branch information
lealife committed May 25, 2016
1 parent fae4588 commit 97e6783
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions Leanote/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,17 @@ - (void)customizeAppearance
[SVProgressHUD setErrorImage:[UIImage imageNamed:@"hud_error"]];
[SVProgressHUD setSuccessImage:[UIImage imageNamed:@"hud_success"]];


// uisearchbar的cancel文字
NSShadow *shadow = [NSShadow new];
[shadow setShadowColor:[UIColor clearColor]];
[shadow setShadowOffset:CGSizeMake(0.0f, -1.0f)];
UIBarButtonItem *barButtonItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UISearchBar class]]];
[barButtonItem setTitleTextAttributes:@{
NSForegroundColorAttributeName: [WPStyleGuide wordPressBlue],
NSShadowAttributeName: shadow,
}
forState:UIControlStateNormal];
[[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil]
setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[WPStyleGuide wordPressBlue],
UITextAttributeTextColor,
[UIColor clearColor],
UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, -1)],
UITextAttributeTextShadowOffset,
nil]
forState:UIControlStateNormal];
}

- (void)applicationWillResignActive:(UIApplication *)application
Expand Down

0 comments on commit 97e6783

Please sign in to comment.