Label & keyboard input possible?

I was rather skeptical about auto layout until I actually tried it in Swift, then in Xojo. Especially on iPhone, it is very convenient.

In my app I have only one view where I had to change the layout manually when rotation happens, because I needed drastically different layouts.

As it stands today, BTW, one can use the constraints to make the layout static as well (reference to parent left and parent top), so am OK with that.

The way they have set up screens between iPad and iPhone, one can have very different designs and it is quite fine.

The line is less evident with the iPhone 6 Plus, though.

For me, the most important part is to have enough flexibility to do what I want without being forced by auto layout. It was the case at the beginning of beta, but Xojo has listened quite a bit, and I think they got to a fairly good compromise. I even look forward to see such implementation available in WE, where screen size varies even more than in iOS.

I guess Xojo doesn’t expose “adjustsFontSizeToFitWidth” function of TextField?

There is a declare. I use it in a label of my app :

declare sub setAdjustsFontSizeToFitWidth lib "Foundation" selector "setAdjustsFontSizeToFitWidth:" (obj as ptr,value as Boolean) setAdjustsFontSizeToFitWidth(ptr(me.Handle),true)

[quote=154452:@Michel Bujardet]@Dave S I guess Xojo doesn’t expose “adjustsFontSizeToFitWidth” function of TextField?
There is a declare. I use it in a label of my app :

declare sub setAdjustsFontSizeToFitWidth lib “Foundation” selector “setAdjustsFontSizeToFitWidth:” (obj as ptr,value as Boolean)
setAdjustsFontSizeToFitWidth(ptr(me.Handle),true)[/quote]

OK, I am laughing my @ss of for this. :slight_smile:
Really, I was adding some code in the TextChanged event to get this working and now there seems to be a simple function for this.
This works perfect.
Again thank you Michel and Dave. :slight_smile:

[quote=154448:@Michel Bujardet]Christophe, I am disappointed in you :wink: What happened to graphics text measurement ? Try this :

Sub TextChange()
static oldtext as text = me.text

dim btmp as new iOSBitmap(me.height, me.Width, 1.0, False)

btmp.Graphics.TextFont = me.TextFont

if btmp.Graphics.TextLineSize(me.text).width > 280 then
me.text = oldtext+"…"
return
else
oldtext = me.text
end if
End Sub
It makes the TextArea stop entry whenever the width of the text goes over 280, and even adds the elipse.[/quote]

Well, I knew this is working in the old framework. But never thought it would work in the new framework. Too… no need for this now (the declare above is what I need), but it will for sure in the future.