B4J Question XCustomListView empty background color

Discussion in 'B4J Questions' started by stevel05, Jun 28, 2018.

  1. stevel05

    stevel05 Expert Licensed User

    Is there a standard way to set the background color for the empty area of an xCustomListview? I can't seem to find it.

    In the attached image the xCustomListView fills the whole screen and has 1 entry.

    upload_2018-6-28_8-23-35.png
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. stevel05

    stevel05 Expert Licensed User

    Thanks Erel, I was hoping that there would be a cross-platform solution.
     
  4. stevel05

    stevel05 Expert Licensed User

    In Code this acheives the same:

    Code:
    CallSubDelayed3(Me,"SetScrollPaneBackgroundColor",CLV,XUI.Color_Black)

    #If B4j
    Private Sub SetScrollPaneBackgroundColor(View As CustomListView, Color As Int)
        Dim SP As JavaObject = View.GetBase.GetView(0)
        Dim V As B4XView = SP
        V.Color = Color
        Dim V As B4XView = SP.RunMethod("lookup",Array(".viewport"))
        V.Color = Color
    End Sub
    #End If
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    You don't need to do anything special in B4A and B4i. Just make the divider color and the background color transparent. In B4J you also need to load the CSS file.
     
    stevel05 likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice