如果我在a中有一个带有排除路径的TextView,UITableViewCell
我如何计算给定字符串的单元格高度?
我已经使用iOS 5中新的UIViewController容器视图控制器方法创建了一个自定义容器视图控制器.
麻烦的是,即使我的容器控制器的子UIViewController有definesPresentationContext = YES
,当它创建并呈现另一个模态视图控制器时,UIKit将容器(而不是子容器)设置为呈现控制器.
例如,在MyChildViewController.m中:
- (void)showMailComposeView:(id)sender {
__block MFMailComposeViewController *vc =
[[MFMailComposeViewController alloc] init];
vc.mailComposeDelegate = self;
vc.subject = @"Subject";
self.definesPresentationContext = YES;
[self presentViewController:vc animated:YES completion:^{
if ([self.modalViewController isEqual:vc])
NSLog(@"This should print...");
if ([vc.presentingViewController isEqual:self.parentViewController])
NSLog(@"... but this shouldn't");
// NOTE: Both log statements printed
}];
}
- (void)mailComposeController:(MFMailComposeViewController*)controller
didFinishWithResult:(MFMailComposeResult)result
error:(NSError*)error
{
[self dismissViewControllerAnimated:YES completion:^{}];
// NOTE: self.parentViewController.view now displays instead of self.view
}
Run Code Online (Sandbox Code Playgroud)
我哪里错了?
我如何确保在模态视图被解除时(而不是容器视图)显示的子视图?
cocoa-touch ×1
height ×1
ios ×1
ios5 ×1
objective-c ×1
textkit ×1
uikit ×1
uitableview ×1
uitextview ×1