mirror of
https://github.com/zhigang1992/shadowsocks-iOS.git
synced 2026-04-24 04:54:51 +08:00
fix iPad
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
cancelButton = [[UIButton alloc] initWithFrame:CGRectMake(320 - 44 - 10, 20, 44, 44)];
|
||||
cancelButton = [[UIButton alloc] initWithFrame:CGRectMake(self.view.bounds.size.width - 44 - 10, 20, 44, 44)];
|
||||
[cancelButton setImage:[UIImage imageNamed:@"cancel"] forState:UIControlStateNormal];
|
||||
[cancelButton addTarget:self action:@selector(cancel) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.view addSubview:cancelButton];
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
@interface SWBViewController () {
|
||||
AVAudioPlayer *player;
|
||||
UIPopoverController *settingsPC;
|
||||
UIBarButtonItem *actionBarButton;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -84,6 +85,7 @@
|
||||
_cancelButton.width = kCancelButtonWidth;
|
||||
UIBarButtonItem *_actionButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(addrBarViewMoreDidClick)];
|
||||
_actionButton.width = kActionButtonWidth;
|
||||
actionBarButton = _actionButton;
|
||||
|
||||
self.addrItemsInactive = [NSMutableArray arrayWithObjects:
|
||||
[[UIBarButtonItem alloc] initWithCustomView:_urlField],
|
||||
@@ -331,7 +333,8 @@
|
||||
CGRect newTabRect = [self.tabBar aNewTabButton].frame;
|
||||
newTabRect.size.width = newTabRect.size.height;
|
||||
CGRect rect = [self.tabBar convertRect:newTabRect toView:self.view];
|
||||
[settingsPC presentPopoverFromRect:rect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
|
||||
// [settingsPC presentPopoverFromRect:rect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
|
||||
[settingsPC presentPopoverFromBarButtonItem:actionBarButton permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
|
||||
} else {
|
||||
[self presentModalViewController:nav animated:YES];
|
||||
}
|
||||
@@ -349,7 +352,8 @@
|
||||
CGRect newTabRect = [self.tabBar aNewTabButton].frame;
|
||||
newTabRect.size.width = newTabRect.size.height;
|
||||
CGRect rect = [self.tabBar convertRect:newTabRect toView:self.view];
|
||||
[settingsPC presentPopoverFromRect:rect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
|
||||
// [settingsPC presentPopoverFromRect:rect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
|
||||
[settingsPC presentPopoverFromBarButtonItem:actionBarButton permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
|
||||
} else {
|
||||
[self presentModalViewController:nav animated:YES];
|
||||
}
|
||||
@@ -392,7 +396,8 @@
|
||||
CGRect newTabRect = [self.tabBar aNewTabButton].frame;
|
||||
newTabRect.size.width = newTabRect.size.height;
|
||||
CGRect rect = [self.tabBar convertRect:newTabRect toView:self.view];
|
||||
[self.actionSheet showFromRect:rect inView:self.view animated:YES];
|
||||
// [self.actionSheet showFromRect:rect inView:self.view animated:YES];
|
||||
[self.actionSheet showFromBarButtonItem:actionBarButton animated:YES];
|
||||
} else {
|
||||
[self.actionSheet showInView:self.view];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user