mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-19 22:22:06 +00:00
Update AppIconOptionsController.m
This commit is contained in:
parent
faa9590ac7
commit
c409041e93
1 changed files with 16 additions and 0 deletions
|
|
@ -27,6 +27,14 @@
|
|||
self.backButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
NSBundle *backIcon = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"uYouPlus" ofType:@"bundle"]];
|
||||
UIImage *backImage = [UIImage imageNamed:@"Back.png" inBundle:backIcon compatibleWithTraitCollection:nil];
|
||||
backImage = [self resizeImage:backImage newSize:CGSizeMake(24, 24)];
|
||||
if ([self isDarkBackground]) {
|
||||
backImage = [backImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
|
||||
[self.backButton setTintColor:[UIColor whiteColor]];
|
||||
} else {
|
||||
backImage = [backImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
|
||||
[self.backButton setTintColor:[UIColor blackColor]];
|
||||
}
|
||||
[self.backButton setImage:backImage forState:UIControlStateNormal];
|
||||
[self.backButton addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.backButton setFrame:CGRectMake(0, 0, 24, 24)];
|
||||
|
|
@ -151,6 +159,14 @@
|
|||
return resizedImage;
|
||||
}
|
||||
|
||||
- (UIImage *)resizeImage:(UIImage *)image newSize:(CGSize)newSize {
|
||||
UIGraphicsBeginImageContextWithOptions(newSize, NO, [UIScreen mainScreen].scale);
|
||||
[image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
|
||||
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
|
||||
UIGraphicsEndImageContext();
|
||||
return newImage;
|
||||
}
|
||||
|
||||
- (void)showAlertWithTitle:(NSString *)title message:(NSString *)message {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
|
|
|||
Loading…
Reference in a new issue