Hi you all.
:sign0085: This is my first post on this forum, so please forgive me when I'm not following any rules.
I first tried to solve my problem by reading as much posts as I could find about it, but that doesn't help. After three days of looking around and trying, I need help.
This is my problem :
I'm defining a Listview in my layout by code, which works fine.
But then I want the TwoLinesLayout's first and second line to be set to a bigger height, to show a text that's longer than the width of the Listview. I just want to do this at defining the ListView, not while already defined.
Now I'm puzzled by some strange behaviour :
When I change the height of the first line, it does not change!
When I change the height of the second line, it does not change either!
Now when I change the ItemHeight the first lines Height does not change, but the second lines Height DOES!
Correct me if I'm wrong, but I would suspect that setting the Height for the first line should change it, as it should do with the second lines. Of course, the total ItemHeight must be the same or more as the sum of the first and second lines.
A sample of my code :
I'm defining the properties of the Listview lstWijn in the first lines of the code.
It's the last lines that keep me puzzled :
Changing the heights on both lines from 100 to any other value makes no difference, the lines will all be the same "standard" size.
When changing both heights and uncommenting the ItemHeight calculation, only the second lines of the Listview become bigger and show the displayed text wrapped around as I like it. It's only too high, as if the height for the first line is also added to the second line.
But I also want the first lines to be changed and the second lines to the amount that I specified, no more, no less!!
I have read that a ScrollView is much more flexible, but I'm a newbie and I just want a simple list (=listview) of two items per record. Apart from the problems with sizing, it suits me very well.
Thanks in advance for repying.
:sign0085: This is my first post on this forum, so please forgive me when I'm not following any rules.
I first tried to solve my problem by reading as much posts as I could find about it, but that doesn't help. After three days of looking around and trying, I need help.
This is my problem :
I'm defining a Listview in my layout by code, which works fine.
But then I want the TwoLinesLayout's first and second line to be set to a bigger height, to show a text that's longer than the width of the Listview. I just want to do this at defining the ListView, not while already defined.
Now I'm puzzled by some strange behaviour :
When I change the height of the first line, it does not change!
When I change the height of the second line, it does not change either!
Now when I change the ItemHeight the first lines Height does not change, but the second lines Height DOES!
Correct me if I'm wrong, but I would suspect that setting the Height for the first line should change it, as it should do with the second lines. Of course, the total ItemHeight must be the same or more as the sum of the first and second lines.
A sample of my code :
B4X:
lstWijn.Initialize("")
lstWijn.Color = Colors.Blue
lstWijn.ScrollingBackgroundColor = Colors.Blue
lstWijn.FastScrollEnabled = True
lstWijn.TwoLinesLayout.Label.Width = 80%x
lstWijn.TwoLinesLayout.SecondLabel.Width = 80%x
lstWijn.TwoLinesLayout.Label.TextSize = 18
lstWijn.TwoLinesLayout.SecondLabel.TextSize = 18
lstWijn.TwoLinesLayout.Label.Color = Colors.Blue
lstWijn.TwoLinesLayout.Label.TextColor = Colors.Yellow
lstWijn.TwoLinesLayout.SecondLabel.Color = Colors.Blue
lstWijn.TwoLinesLayout.SecondLabel.TextColor = Colors.Yellow
lstWijn.TwoLinesLayout.Label.Gravity = Gravity.TOP
lstWijn.TwoLinesLayout.SecondLabel.Gravity = Gravity.TOP
lstWijn.TwoLinesLayout.Label.Height = 100
lstWijn.TwoLinesLayout.SecondLabel.Height = 100
' lstWijn.TwoLinesLayout.ItemHeight = lstWijn.TwoLinesLayout.Label.Height + lstWijn.TwoLinesLayout.SecondLabel.Height
Activity.AddView(lstWijn, 0, 24%y, 100%x, 71%y)
I'm defining the properties of the Listview lstWijn in the first lines of the code.
It's the last lines that keep me puzzled :
B4X:
lstWijn.TwoLinesLayout.Label.Height = 100
lstWijn.TwoLinesLayout.SecondLabel.Height = 100
' lstWijn.TwoLinesLayout.ItemHeight = lstWijn.TwoLinesLayout.Label.Height + lstWijn.TwoLinesLayout.SecondLabel.Height
Activity.AddView(lstWijn, 0, 24%y, 100%x, 71%y)
Changing the heights on both lines from 100 to any other value makes no difference, the lines will all be the same "standard" size.
When changing both heights and uncommenting the ItemHeight calculation, only the second lines of the Listview become bigger and show the displayed text wrapped around as I like it. It's only too high, as if the height for the first line is also added to the second line.
But I also want the first lines to be changed and the second lines to the amount that I specified, no more, no less!!
I have read that a ScrollView is much more flexible, but I'm a newbie and I just want a simple list (=listview) of two items per record. Apart from the problems with sizing, it suits me very well.
Thanks in advance for repying.