1

我的视图控制器中有两个子视图,都嵌入在 UIScrollview 中。其中一个是 UIView 的子类,另一个是在界面构建器中创建的,其中包含按钮等,但也被我的视图控制器引用...

我使用共享按钮来调用 UIActivityViewController 工作正常。唯一的问题是当我点击 Facebook/Twitter 并分享图像时(效果很好) - 它消失了,但是当我返回时,我在 IB 中创建的 UIView 不可见,它的任何按钮/元素等也不可见。

我在 UIActivity 的完成处理程序中做了一个 nslog,它仍然存在,没有隐藏,并且它的所有子视图的计数返回 19。还要检查它的框架,这很好,所以我不知道它为什么不显示。

非常感谢任何帮助!

NSString *textToPost = @"Text to post";
UIImage *anImage = [self.player imageOfView];
NSArray *activityItems = @[textToPost, anImage];

UIActivityViewController *activityVC = [[UIActivityViewController alloc]initWithActivityItems:activityItems applicationActivities:nil];
activityVC.excludedActivityTypes = @[UIActivityTypePrint];


[self presentViewController:activityVC animated:YES completion:nil];
[activityVC setCompletionHandler:^(NSString *activityType, BOOL completed) {
    NSLog(@"input view status %i/n number of subviews%i", self.inputView.hidden, [self.inputView.subviews count]);
    NSLog(@"%@", NSStringFromCGRect(self.inputView.frame));


}];

输出:

输入视图状态 0/n 子视图数19 {{0, 0}, {320, 438}}

4

1 回答 1

0

well if all are there then may be subview hides by some other view so try with bringSubviewToFront: it may be helps you.

    [yourview bringSubviewToFront:self.view];
于 2013-04-18T15:29:25.483 回答