【发布时间】:2017-05-09 04:47:16
【问题描述】:
Apple 审查是否允许以下编码,即添加 textView 或标签作为“accessoryView”.. 我在很多地方读到它不是公开的 api,我们不应该这样做.. 但很少有人说我们可以。 .. 在我们发送审核时它会被拒绝吗?请指导我...
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 来显示警报。这里有几个链接可能会有所帮助stackoverflow.com/questions/31922349/…stackoverflow.com/questions/37696485/…
-
感谢您的帮助。是的,我使用的是最新版本的 iOS。但我想添加一个文本视图而不是文本字段。
-
好的..我建议在这个链接stackoverflow.com/questions/34420080/…中使用多行文本字段,也看看这个链接stackoverflow.com/questions/28603060/…
-
我可以看到他们已经使用“addSubView”到 UIAlertController 来添加文本视图。这是正确的方法吗?
-
你得到想要的结果了吗?如果是,那么在任何控制器的视图上添加视图都没有害处。 UIAlertcontroller 也是控制器,不像 AlertView。
标签: ios objective-c