fix crashed on iOS7, 8

This commit is contained in:
life
2016-05-25 11:06:52 +08:00
parent fae45887c8
commit 97e6783717

View File

@@ -195,18 +195,17 @@
[SVProgressHUD setErrorImage:[UIImage imageNamed:@"hud_error"]];
[SVProgressHUD setSuccessImage:[UIImage imageNamed:@"hud_success"]];
// uisearchbarcancel
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