B4J Question [CSSUtils] Center ListView?

LWGShane

Well-Known Member
Licensed User
Longtime User
How do I apply this CSS to a ListView with CSSUtils? I've tried and the ListView doesn't center. Any ideas?

Thanks!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
SS-2016-04-15_10.41.10.png


You cannot use CSSUtils for this. You need to use a CSS file for this:
B4X:
Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1
   MainForm.SetFormStyle("UNIFIED")
   MainForm.RootPane.LoadLayout("1")
   MainForm.Show
   ListView1.Id = "lv"
   MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "lv.css"))
   For i = 1 To 100
     ListView1.Items.Add(i)
   Next
End Sub

The project is attached.
 

Attachments

  • ListView_Center.zip
    1.8 KB · Views: 236
Upvote 0
Top