【问题标题】:Not able to understand iOS System UIPasteboard无法理解 iOS 系统 UIPasteboard
【发布时间】:2015-03-30 14:17:58
【问题描述】:

我正在开发自定义表情符号键盘,它是一个键盘扩展,问题是在单击按钮时我需要将图像复制到粘贴板并将其粘贴到另一个应用程序中。我已经使用了这些代码,但无法将图像复制到粘贴板中

-.h 文件中的代码

    UIPasteboard *pasteboard_img;

-viewDidLoad() 中的代码

    pasteboard_img = [UIPasteboard generalPasteboard];

-在键盘上按下按钮时调用的方法中的代码

    [pasteboard_img setImage:[UIImage imageNamed:[array_image objectAtIndex:sender.tag]]];

~ 其中array_image 是带有图像名称的数组。

【问题讨论】:

    标签: ios iphone xcode6 uipasteboard


    【解决方案1】:
     pasteboard_img.persistent=YES;
    

    使用这个。

    【讨论】:

    • 这如何添加到已经给出的答案?它没有任何额外的贡献
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-02
    • 2011-02-03
    • 2016-02-29
    • 2011-06-18
    • 2013-06-25
    • 2020-07-01
    相关资源
    最近更新 更多