Android Question the word does not fit.

Almora

Active Member
Licensed User
Longtime User
the word does not fit.
How do I know how to fix it?



B4X:
#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.


End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
      Dim label1 As Label
      Private ScrollView1 As ScrollView
End Sub

Sub Activity_Create(FirstTime As Boolean)

        Activity.LoadLayout("dene")
        
            label1.Initialize("label1")               
        label1.Text=File.ReadString(File.DirAssets,"bx4.txt")
        ScrollView1.Panel.AddView(label1,0,0,100%x,100%y)
       
   Dim s As AutoSizeScroll
   s.set(label1,ScrollView1)        
   label1.TextColor=Colors.Black
   label1.TextSize=14 
   label1.Gravity=Gravity.CENTER_HORIZONTAL
  
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 

Attachments

  • PicsArt_09-23-10.28.48.jpg
    PicsArt_09-23-10.28.48.jpg
    395.3 KB · Views: 191
  • bx4.txt
    755 bytes · Views: 155

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
You could reduce the size of the label a bit so that it better fits inside your scrollview:
B4X:
ScrollView1.Panel.AddView(label1,5dip,0,ScrollView1.Width - 10dip,100%y)
or you could adjust the padding on the label itself through the JavaObject:
B4X:
Public Sub SetViewPadding(v As View, Left As Int, Top As Int, Right As Int, Bottom As Int)
     Dim jo As JavaObject = v
     jo.RunMethod("setPadding", Array As Object(Left, Top, Right, Bottom))
End Sub
 
Upvote 0
Top