Almora Well-Known Member Licensed User Longtime User Sep 23, 2016 #1 the word does not fit. How do I know how to fix it? Code: Copy #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 395.3 KB · Views: 487 bx4.txt bx4.txt 755 bytes · Views: 492
the word does not fit. How do I know how to fix it? Code: Copy #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
eurojam Well-Known Member Licensed User Longtime User Sep 23, 2016 #2 have a look to this thread: https://www.b4x.com/android/forum/threads/label-in-scrollview.29266/#post-169885 may be this will help you... Upvote 0
have a look to this thread: https://www.b4x.com/android/forum/threads/label-in-scrollview.29266/#post-169885 may be this will help you...
Almora Well-Known Member Licensed User Longtime User Sep 23, 2016 #4 do you have a different method? I did not apply Upvote 0
Jeffrey Cameron Well-Known Member Licensed User Longtime User Sep 23, 2016 #5 You could reduce the size of the label a bit so that it better fits inside your scrollview: Code: Copy ScrollView1.Panel.AddView(label1,5dip,0,ScrollView1.Width - 10dip,100%y) or you could adjust the padding on the label itself through the JavaObject: Code: Copy 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
You could reduce the size of the label a bit so that it better fits inside your scrollview: Code: Copy ScrollView1.Panel.AddView(label1,5dip,0,ScrollView1.Width - 10dip,100%y) or you could adjust the padding on the label itself through the JavaObject: Code: Copy 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