tags:

views:

16

answers:

0

Hi there,

I'm trying to subclass UITextView to have a white-on-black background. This works setting

self.backgroundColor = [UIColor blackColor];
self.textColor = [UIColor whiteColor];

However, using instruments color blended layers feature there the custom TextView shows up red, which indicates alpha blending dragging down performance.

Setting

self.opaque = YES;
self.alpha = 1.0;

does not correct this. I added

    for (UIView * view in self.subviews)
    {
        view.opaque = YES;
        view.alpha = 1.0;
        view.backgroundColor = [UIColor blackColor];
    }

to tweak the UIWebDocumentView, which works, except that its background stays white. It is now opaque, but has the wrong color. It seems that setting backgroundColor does not have any effect.

Many thanks for any comment, solution or advise!