This commit is contained in:
clowwindy
2014-02-21 11:28:35 +08:00
parent 5e965462a9
commit d08490fdf6
2 changed files with 9 additions and 4 deletions

View File

@@ -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];

View File

@@ -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];
}