B4A Library DynamicallyResizedLabel

Here is a simple dynamically resizable label inside a panel. Useful for 'posting' like views. Specially using scrollable lists.

 

Attachments

  • DynamicallyResizedLabel Lib V1.0.zip
    3.8 KB · Views: 221
  • DynamicallyResizedLabel Ex.zip
    3.5 KB · Views: 257

peacemaker

Expert
Licensed User
Longtime User
Super.
Suggestion to think about the NinePatch picture background, like attached (place .png into a "drawable" folder of the "res"), with help of sub:
B4X:
Sub LoadNinePatchDrawable(ImageName As String) As Object
    'Gets a 9-patch drawable from the application resources
    Dim r As Reflector
    Dim package As String
    package = r.GetStaticField("anywheresoftware.b4a.BA", "packageName")
    Dim ID_Drawable As Int
    ID_Drawable = r.GetStaticField(package & ".R$drawable", ImageName)
    r.Target = r.GetContext
    r.Target = r.RunMethod("getResources")
    Return r.RunMethod2("getDrawable", ID_Drawable, "java.lang.int")
End Sub

Label1.Background = LoadNinePatchDrawable("balloon_left")
 

Attachments

  • balloon_left.9.png
    728 bytes · Views: 200
  • balloon_right.9.png
    1.7 KB · Views: 198
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…