首页 > 其他 > 详细

复制文字,链接,剪贴板的使用

时间:2016-01-03 17:11:40      阅读:282      评论:0      收藏:0      [点我收藏+]

//获取剪贴板

        UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];

        //设置剪贴板内容

        pasteboard.string = [defaults objectForKey:@"shareURL"];

        if (pasteboard.string) {

            _alertView = [[AlertView alloc] initWithFrame:CGRectMake((UIScreen_width-(UIScreen_width/320)*150)/2, (UIScreen_width/320)*220, (UIScreen_width/320)*150, (UIScreen_width/320)*30)];

            [_alertView createAlertViewWithTitle:@"已复制到粘贴板" delayInSeconds:2 completion:^{

                [_alertView removeFromSuperview];

            }];

            [self.view addSubview:_alertView];

        } else {

            _alertView = [[AlertView alloc] initWithFrame:CGRectMake((UIScreen_width-(UIScreen_width/320)*150)/2, (UIScreen_width/320)*220, (UIScreen_width/320)*150, (UIScreen_width/320)*30)];

            [_alertView createAlertViewWithTitle:@"复制失败" delayInSeconds:2 completion:^{

                [_alertView removeFromSuperview];

            }];

            [self.view addSubview:_alertView];

        }

复制文字,链接,剪贴板的使用

原文:http://www.cnblogs.com/OIMM/p/5096560.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!