Objective c 当我更改图幅iOS 8时,UIViewController视图消失
这段代码在iOS 7上运行得很好,但是当它在XCode 6和iOS8模拟器中运行时,在我对self.webview.frame做了一个小更改之后,视图就会消失(调用UIViewController ViewWillEnglish)。当我从操作表中选择“编辑”选项时,就会发生这种情况。但是,当我点击webView并单击notify/call键盘时,它不会消失。此UIViewController是由rootViewController以modalPresentationStyle:UIModalPresentationFormSheet呈现的。如果有任何帮助,我将不胜感激Objective c 当我更改图幅iOS 8时,UIViewController视图消失,objective-c,uiviewcontroller,ios8,Objective C,Uiviewcontroller,Ios8,这段代码在iOS 7上运行得很好,但是当它在XCode 6和iOS8模拟器中运行时,在我对self.webview.frame做了一个小更改之后,视图就会消失(调用UIViewController ViewWillEnglish)。当我从操作表中选择“编辑”选项时,就会发生这种情况。但是,当我点击webView并单击notify/call键盘时,它不会消失。此UIViewController是由rootViewController以modalPresentationStyle:UIModalPr
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
NSString *title = [actionSheet buttonTitleAtIndex:buttonIndex];
if([title isEqualToString:@"Edit"]){
[self switchModeTo:@"Edit"];
}
}
- (void)switchModeTo:(NSString *)mode{
if([mode isEqualToString:@"Edit"]){
self.isEditMode = YES;
[self.btnApply setHidden:NO];
[self.btnMore setHidden:YES];
CGRect frame = [self.webview frame];
frame.origin.y = 44;
frame.size.height = 492;
[self.webview setFrame:frame];
}
}
- (void)keyBoardWillShow:(NSNotification *)notif{
[self switchModeTo:@"Edit"];
}
我有一个非常类似的问题。我试图呈现从操作表触发的模式视图控制器。模态视图已呈现,然后立即被驳回 我创建了另一个测试用例,并收到以下消息:
Warning: Attempt to present <ModalViewController: 0x78fbadd0> on <MainViewController: 0x78fa71c0> which is already presenting (null)
- (void)actionSheet:(UIActionSheet *)actionSheet
clickedButtonAtIndex:(NSInteger)buttonIndex
{
if ( buttonIndex != actionSheet.cancelButtonIndex ) {
[self performSelector:@selector(showModalView) withObject:nil afterDelay:0.3];
}
}
- (void)showModalView
{
ModalViewController* modalVC = [[ModalViewController alloc] init];
[self presentViewController:modalVC animated:YES completion:nil];
}