Android Question Listview + DBUtils: can't set text size

TrisectDevelopment

Active Member
Licensed User
Longtime User
I'm filling a listview with data from DBUtils.ExecuteListView and trying to set color and size like this.

B4X:
    DBUtils.ExecuteListView(SQL, "SELECT Opgave, ID FROM Opgaver", Null, 0, lvOpgaver, False)

    lvOpgaver.TwoLinesLayout.Label.Visible = False
    lvOpgaver.TwoLinesLayout.Label.Height = 8dip
    lvOpgaver.TwoLinesLayout.SecondLabel.Text = 8dip
    lvOpgaver.TwoLinesLayout.SecondLabel.TextColor = Colors.Black

But it does absolutly nothing what ever i put as textsize or color.
I tried without or with dip but still no effect.

What am I doing wrong?
 

klaus

Expert
Licensed User
Longtime User
Try to move DBUtils.ExecuteListView after the layout definitions.
B4X:
lvOpgaver.TwoLinesLayout.Label.Visible = False
lvOpgaver.TwoLinesLayout.Label.Height = 8dip
lvOpgaver.TwoLinesLayout.SecondLabel.Text = 8dip
lvOpgaver.TwoLinesLayout.SecondLabel.TextColor = Colors.Black

DBUtils.ExecuteListView(SQL, "SELECT Opgave, ID FROM Opgaver", Null, 0, lvOpgaver, False)
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I didn't look enough carefully at your code.
The problem is that you define the lvOpgaver.TwoLinesLayout, but you fill the ListView with a single line !
In this line:
DBUtils.ExecuteListView(SQL, "SELECT Opgave, ID FROM Opgaver", Null, 0, lvOpgaver, False)
False means single line, if you want two lines you must set it to True !
Or you must set the SingleLineLayout.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…