Objective c 在iPhone上复制UIWebView中的文本时如何更改镜像中的颜色
我有一个黑色背景和白色(浅灰色)文本的UIWebView。在选择要复制的文本时,它几乎不可用,因为“镜像”默认为白色背景色。有没有办法改变这种行为Objective c 在iPhone上复制UIWebView中的文本时如何更改镜像中的颜色,objective-c,ios4,uiwebview,copy-paste,Objective C,Ios4,Uiwebview,Copy Paste,我有一个黑色背景和白色(浅灰色)文本的UIWebView。在选择要复制的文本时,它几乎不可用,因为“镜像”默认为白色背景色。有没有办法改变这种行为 截图:因为Ben Gottlieb已经回答了我面前的问题: - (void) drawRect: (CGRect) rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGRect bounds = self.bounds; CGIm
截图:因为Ben Gottlieb已经回答了我面前的问题:
- (void) drawRect: (CGRect) rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGRect bounds = self.bounds;
CGImageRef mask = [UIImage imageNamed: @"loupeMask"].CGImage;
UIImage *glass = [UIImage imageNamed: @"loupeImage"];
CGContextSaveGState(context);
CGContextClipToMask(context, bounds, mask);
CGContextFillRect(context, bounds);
CGContextScaleCTM(context, 2.0, 2.0);
//draw your subject view here
CGContextRestoreGState(context);
[glass drawInRect: bounds];
}
有关更多详细信息,请查看,虽然此链接可以回答问题,但最好在此处包含答案的基本部分,并提供链接以供参考。MichaelRoland注意到,如果链接页面发生更改,只有链接的答案可能会无效。