Input Text field auto Resize

This is the place to discuss anything relating to MobGUI

Moderators: heatherlaine, robinmiller, kevinmiller, malte, splash21

Post Reply
donizeti.borges
Posts: 15
Joined: Tue Sep 03, 2013 8:33 pm

Input Text field auto Resize

Post by donizeti.borges » Sun Jul 27, 2014 2:41 pm

Hi

I am working in a mobile project that will run on Iphone and Ipad using LC independence resizing + MobGui controls .

On Iphone the font size works fine in Input text, but when I try to run on Ipad the control resize in terms of width and height but the font keep small.

I tried to mark Auto Fit Property, but without success.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5132
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Input Text field auto Resize

Post by Mark » Sun Jul 27, 2014 10:29 pm

Hi,

Change the textSize of the field to a bigger value or change the textSize of the text. You can do this in the IDE or by script:

Code: Select all

set the textSize of fld x to 24
set the textSize of char 1 to -1 of fld x to 36
Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

donizeti.borges
Posts: 15
Joined: Tue Sep 03, 2013 8:33 pm

Re: Input Text field auto Resize

Post by donizeti.borges » Tue Jul 29, 2014 3:39 am

Hi Mark

Thank you for the answer! but I think that isn't the solution for my issue.

Mobgui use a native text control to implement input text and the way to change the size is using mobilecontrolset.

The LC independence resolution resize automatically all controls of my card including fonts too, just mobgui text input was not resized.

Kind regards,

Donizeti

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5132
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Input Text field auto Resize

Post by Mark » Wed Jul 30, 2014 8:29 am

Hi Donizeti,

If you can find out which ID MobGUI uses for the text input control, you can use the following syntax to change the text size:

Code: Select all

mobileControlSet gMobileControlID,"textSize",36
More useful is probably the autoFit property:

Code: Select all

mobileControlSet gMobileControlID,"autoFit",true
mobileControlSet gMobileControlID,"minimumFontSize",10
but note that this works on iOS only.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: Input Text field auto Resize

Post by splash21 » Wed Jul 30, 2014 7:48 pm

Hi Donizeti, I'm abroad until 9th August. If you follow Mark's advice, everything should work 8)
LiveCode Development & Training : http://splash21.com

Post Reply

Return to “MobGUI”