我有一个activityViewController共享我的应用程序的链接,它在iOS 7上运行得很好,虽然在iOS 8上它会在点击关闭按钮时冻结我的应用程序。
以下是我运行activityViewController的方法
activityViewController = [[UIActivityViewController alloc] initWithActivityItems:[NSArray arrayWithObjects:@"Check out Punch Slip on the AppStore! You can record your hours, see how much you made, and even email your log. \n https://itunes.apple.com/us/app/punch-slip/id531560298?ls=1&mt=8", nil] applicationActivities:nil];
[self presentViewController:activityViewController animated:YES completion:nil];
我的日志显示此错误
IOS 8中的活动视图控制器是否有变化?
可以添加到我的viewController的视图添加如下:
CGRect screenBound = [[UIScreen mainScreen] bounds];
CGSize screenSize = screenBound.size;
CGFloat screenHeight = screenSize.height;
pickerSubView = [[UIView alloc] init];
//Find screensize and take y-464
yHeight = (screenHeight / 20) * 11;
NSLog(@"%d", yHeight);
pickerSubView.frame = CGRectMake(0, yHeight, 320, 464);
pickerSubView.backgroundColor=[UIColor whiteColor];
[pickerSubView addSubview:categoryPickerView];
[pickerSubView addSubview:pickerToolbar];
[self.view addSubview:pickerSubView];
[pickerSubView setFrame:CGRectMake(0.0f, 800.0f, 320.0f, 480.0f)]; //notice this is OFF screen!
[UIView beginAnimations:@"animateTableView" context:nil];
[UIView setAnimationDuration:0.5];
[pickerSubView setFrame:CGRectMake(0, yHeight, 320, 464)]; //notice this is ON screen!
[UIView commitAnimations];
然后删除像这样:
[pickerSubView setFrame:CGRectMake(0, yHeight, 320, 464)]; //notice this is OFF screen!
[UIView beginAnimations:@"animateTableView" context:nil];
[UIView setAnimationDuration:0.5];
[pickerSubView setFrame:CGRectMake(0.0f, 800.0f, 320.0f, 480.0f)]; //notice this is ON screen!
[UIView commitAnimations];
[pickerSubView removeFromSuperview];
我现在认为,由于第一组线路,它可能只是苹果方面的问题。我认为这是activityviewcontroller的取消按钮
的问题
答案 0 :(得分:1)
使用Xcode 6 beta 2不再存在该问题
答案 1 :(得分:0)
尝试在setTranslatesAutoresizingMaskIntoConstraints:NO
上致电pickerSubView
。由于您是以编程方式创建的,因此它的超级视图可能会生成您不知道导致约束冲突的约束。