views:

731

answers:

3

You guys helped so much with my last question, I figured I'd give you a shot at another. I have written an app with a theme that uses a dark blue glassy background and white / gray text and labels. The textfields in my app have clearcolor backgrounds and white texts and everything shows up very well. My only concern is that when you hold down a touch in a text box to get the magnification loupe, of course the white text shows up on a white background... which you can not read. Anybody got any ideas on how to implement a usable loupe here?

+2  A: 

Unfortunately, the only "public" way I know how to change the loupe background is by setting textField.backgroundColor

I assume that since you're setting your backgrounds as clearColor, the magnifier defaults to white background, so the only way is to set your backgroundColor as something not clear.

I'm also assuming that since you did mention that you set your backgrounds a clear, that having it not be clear is not an option. So two ways I can think up in my mind about how to get around this is:

  1. Assuming that the magnification lopue gets its background color by calling the backgroundColor implementation (and not some other obscure private API method): override the backgroundColor method and return a solid color.
  2. Create your own loupe (probably not feasible)
James
+1  A: 

Actually its pretty feasible to create your own loop. Haven't tried subitting to apple yet so don't know how they feel about it.

Basic idea is override touches, use a timer to see how long the user has been touching the screen. The loupe is just a UIView that grabs as an image the view behind it and magnifies it.

Check out this article from Craftymind here

The article has you cache the entire image behind which is definitely faster, for rendering the loupe, but if you have stuff (i.e. textFields) that are constantly changing I've been able to render the loope image real-time without too much of a performance hit.

kiyoshi
+2  A: 
Max Kilgore