0

I have a UIWebView with black background and white (light gray) text. It's almost unusable while selecting text to copy, because the "mirror" is on white background color by default. Is there any way how to change this behavior?

Screenshot: enter image description here

BobC
  • 639
  • 5
  • 19

1 Answers1

1

as Ben Gottlieb have already answered the question before me:

- (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];
}

for more details please check iPhone, reproduce the magnifier effect

Community
  • 1
  • 1
Ahmad Kayyali
  • 8,233
  • 13
  • 49
  • 83