Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I figured out a simple work around that achieved the desired effect. I also went through the full process of making my own loupe but since there is clear documentation on making your own loupe (see kiyoshi's answer), and this other method is ridiculously simple, I decided to document it here. It is basically just faking the clear background so that the white text shows up in the loupe. The background I am using for the view looks like blue smoke on a darker blue background:</p> <p><a href="http://img231.imageshack.us/img231/9835/beforestatex.jpg" rel="nofollow noreferrer">alt text http://img231.imageshack.us/img231/9835/beforestatex.jpg</a></p> <p>I took a screenshot of the simulator with the textfield visible and a black background so it would show up better:</p> <p><a href="http://img193.imageshack.us/img193/9023/blackfieldx.jpg" rel="nofollow noreferrer">alt text http://img193.imageshack.us/img193/9023/blackfieldx.jpg</a></p> <p>Then I took that screenshot and made it semi transparent in photoshop, and overlayed my original background image to find exactly where the textfield appeared on the background:</p> <p><a href="http://img266.imageshack.us/img266/9493/transparencyfullscreenx.jpg" rel="nofollow noreferrer">alt text http://img266.imageshack.us/img266/9493/transparencyfullscreenx.jpg</a></p> <p>Then I copied the exact pixels that would be used as the background of the textfield into a new PNG and saved that and set it as the the background image:</p> <p><a href="http://img41.imageshack.us/img41/3450/textboxback.png" rel="nofollow noreferrer">alt text http://img41.imageshack.us/img41/3450/textboxback.png</a></p> <h2>forwardToField.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed:@"textboxback.png"]];</h2> <p>Keep in mind that the image will be repeated as a pattern within the loupe... so if you don't want to see the edges, simply make sure your textfield is larger than the loupe height and width.</p> <h2>Before:</h2> <p><a href="http://img196.imageshack.us/img196/2672/beforex.jpg" rel="nofollow noreferrer">alt text http://img196.imageshack.us/img196/2672/beforex.jpg</a></p> <h2>After:</h2> <p><a href="http://img23.imageshack.us/img23/2182/afterxd.jpg" rel="nofollow noreferrer">alt text http://img23.imageshack.us/img23/2182/afterxd.jpg</a></p> <p>I hope this helps somebody out there!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload