如何在用户点击复制后从UIPasteboard获取图像实际上我可以从UIPasteboard获取Nsdata但我认为需要将特定的编码分配给uiimageview我该怎么做?谢谢你的帮助。
答案 0 :(得分:0)
NSData *data = // however you obtain the data
UIImage *image = [[UIImage alloc] initWithData:data];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
[self.view addSubview:imageView];
更好:
UIImage *image = [[UIPasteboard generalPasteboard] image];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
[self.view addSubview:imageView];