Text indents in MobileTextArea

Hi

Would like to know if anyone has set a text indent to a MobileTextArea?
Any suggestions would be awesome.

thanks
mich

I think I have.

I’ll find the code later today.

1 Like

If you have iOSDesignExtensions in your app:

declare sub setTextContainerInset lib "UIKit" selector "setTextContainerInset:" (obj as ptr, value As ExtensionsXC.xcUIEdgeInsets)

Dim insets As ExtensionsXC.xcUIEdgeInsets
insets.Left = 20 //20pt indent
insets.Top = 4
insets.Right = 2
insets.Bottom = 2

setTextContainerInset(TextArea1.handle, insets) 

If you don’t have iOSDesignExtensions, add a Module named ExtensionsXC in your project and in that module add:

Protected Structure xcUIEdgeInsets
  Top as CGFloat
  Left As CGFloat
  Bottom As CGFloat
  Right As CGFloat
End Structure

Result:
TextArea at the top, no indent.
TextArea at the bottom, 20pt left indent

2 Likes

That’s great, perfect! Thanks for that Jeremie!