我使用UIToolbar作为UITextView的inputAccessoryView,里面有一些UIBarItems。
self.toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
NSMutableArray *items = [[NSMutableArray alloc] init];
UIBarButtonItem *bold = [[UIBarButtonItem alloc] initWithTitle:@"B" style:UIBarButtonItemStyleBordered target:self action:@selector(bold)];
UIBarButtonItem *italic = [[UIBarButtonItem alloc] initWithTitle:@"I" style:UIBarButtonItemStyleBordered target:self action:@selector(italic)];
UIBarButtonItem *underline = [[UIBarButtonItem alloc] initWithTitle:@"U" style:UIBarButtonItemStyleBordered target:self action:@selector(underline)];
[items addObject:underline];
[items addObject:italic];
[items addObject:bold];
self.toolbar.items = items;
[self.textView setInputAccessoryView:self.toolbar]
这些项目工作正常,但是当UIActivityViewController激活时,则在iOS6模拟器中关闭,这些项目都消失,只显示空白工具栏。
是什么原因?请帮忙!