Set label to SingleLine=true

moster67

Expert
Licensed User
Longtime User
I believe I read somewhere that labels are multiline by default.

Is it possible to set a label as SingleLine just like you can do with EditText?
 
Couldn't find that property so it is probably not possible. As a workaround I guess it is sufficient to ensure that the Height of the label is not higher than one single-line (perhaps also taking into account text-size).
 
Upvote 0
FYI, the equivalent JavaObject sub is:

Code: Copy
Sub setLabelSingleLine(viewArg As View, singleLineArg As Boolean)
   Dim jo As JavaObject = viewArg
   jo.RunMethod("setSingleLine", Array As Object(singleLineArg))
End Sub

I would love to see more and more of these secondary functions become native B4A methods, so we can use fewer reflector/JavaObject workarounds. :)
 
Upvote 0
Back
Top