Apple审查允许下面的代码,即添加一个textView或标签作为“accessoryView”..我读了很多地方,它不是一个公众暴露的API,我们不应该这样做..但很少说我们可以..当我们发送评论时它会被拒绝吗?请指导我...将UITextView或UILabel添加为UIAlertView作为“accessoryView”?
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 100, 200)];
textView.selectable = YES;
textView.editable = NO;
textView.attributedText = attributedStr;
UIAlertView *customAlert = [[UIAlertView alloc] initWithTitle:@"Title" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil, nil];
[customAlert setValue:textView forKey:@"accessoryView"];
你在最新的iOS版本的工作?如果是,则请使用AlertController显示警报。这里有几个可以帮助的链接http://stackoverflow.com/questions/31922349/how-to-add-textfield-to-uialertcontroller-in-swift http://stackoverflow.com/questions/37696485/show-the -textfield-in-the-alertcontroller-in-swift –
感谢您的帮助。是的,我正在使用最新版本的iOS。但我想添加一个textview而不是一个文本框。 – DivGoogly
好的..我建议去多线textfield作为在这个链接http://stackoverflow.com/questions/34420080/multiline-editable-text-uitextview-inside-uialertcontroller也看看这个链接http://stackoverflow.com/问题/ 28603060 /如何使用uitextview-in-uialertcontroller –