Hi all
I am attempting to load a text file into a label and then add it to a scrollview. It is all working except that the width of the scrollview is too narrow and some of the text at the right is not being displayed. Here is the code:
I have adapted this from an example I saw using a text view so if it is not correct, please advise.
Thanks
I am attempting to load a text file into a label and then add it to a scrollview. It is all working except that the width of the scrollview is too narrow and some of the text at the right is not being displayed. Here is the code:
B4X:
txt = File.ReadString(File.DirAssets, "Lesson0Notes.txt") ' load the text file into the string
lblLesson0Notes.Initialize(" ")
lblLesson0Notes.Font = Font.CreateNew2("schalk",20)
lblLesson0Notes.TextColor = Colors.White
lblLesson0Notes.Multiline = True
lblLesson0Notes.SizeToFit
scvLesson0Notes.Panel.AddView(lblLesson0Notes,0,0,80%x,60%y)
lblLesson0Notes.Text = txt
scvLesson0Notes.ContentHeight = lblLesson0Notes.Height
scvLesson0Notes.ScrollOffsetY = 0
scvLesson0Notes.Width=Page1.RootPanel.Width
scvLesson0Notes.ContentWidth = Page1.RootPanel.Width
lblLesson0Notes.Width=scvLesson0Notes.Width
lblLesson0Notes.SizeToFit
scvLesson0Notes.ContentHeight = lblLesson0Notes.Height
scvLesson0Notes.ContentWidth = scvLesson0Notes.Width
I have adapted this from an example I saw using a text view so if it is not correct, please advise.
Thanks
Last edited: