ios - 如何让用户复制 UIAlertView 的描述?

标签 ios objective-c iphone uialertview

点击 UIButton 后,我将显示带有多行消息的 UIAlertView,以及如何让用户复制/选择该消息。

最佳答案

您是否尝试在 UIAlertView 中添加 UITextView

试试这个:

UIAlertView *testAlert = [[UIAlertView alloc] initWithTitle:@"Hello World ! This is just a test."
                                                        message:@""
                                                       delegate:self
                                              cancelButtonTitle:@"Cancel"
                                              otherButtonTitles:@"Done", nil];
    UITextView *textView = [UITextView new];
    textView.text = @"Hello World ! Hello World ! Hello World ! Hello World ! Hello World !";
    textView.editable = NO;
    textView.userInteractionEnabled = YES;

    [testAlert setValue: textView forKey:@"accessoryView"];
    [testAlert show];

关于ios - 如何让用户复制 UIAlertView 的描述?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42270053/

相关文章:

ios - 单例设计潜在泄漏

objective-c - ios中通过AppDelegate传递数据

iphone - iOS 7 MPMoviePlayerController 更改完成按钮的名称

ios - UIButton 像苹果键盘一样扩展触摸区域

ios - Objective C 属性在使用后传递重置为 null

objective-c - 无法从 iPhone 应用程序中的 URL 播放视频?

iOS facebook api - 获取 friend 的用户名

ios - 旋转存储在文档目录中的图像

ios - Xamarin Forms Maps Circle 自定义渲染器

ios - UITabBar 选定的选项卡在启动时不会更改色调颜色