UITextField - Text Appears Shifted?

Terry Judd terry.judd at unimelb.edu.au
Fri Aug 3 18:03:13 EDT 2012


On 03/08/2012, at 08:41 PM, Scott Rossi wrote:

> Anyone know why the text of a UITextField (input) appears shifted up?  Is
> there any way to shift it down?
> 
> There's very little on the card -- just a group and a graphic to define the
> region in which to display the text.
> 
> http://www.tactilemedia.com/download/uitextfield.png
> 
> The clearbutton for the control is displayed, and this appears in the proper
> position, but for some reason the text is appearing shifted upward about 4
> pixels.  It appears the same in both the simulator and on a device.
> 
> Any suggestions for a fix?

Hi Scott - I seem to recall struggling with this some time ago when I had to implement user and password fields using the native controls. What I seem to have done is create an appropriately sized background to sit behind the control and then used a LC field to position/align the entry text correctly - with the textHeight of the LC field set to the same value as the fontSize. I then create the native control and set its rect to the rect of the LC field and its fontSize to the LC field's fontSize. This seems to work for me.

Terry...

> 
> Thanks & Regards,
> 
> Scott Rossi
> Creative Director
> Tactile Media, UX Design
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 

Dr Terry Judd
Senior Lecturer in Medical Education
Medical Eduction Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne








More information about the use-livecode mailing list