Android Question Set divider color in customlistview

MroBurk

Member
Licensed User
Hi, I need help to set The Divider in Customlistview. If I select in a design view any colors and set the Height to "1", all customlistview is colored the same color I selected for the divider. Please help!!
 

MroBurk

Member
Licensed User
I need help to set the divider, because if I set any height of the divider the entire customlistview is colored... I'm posting the example, if you look at divides in the design view is blue and height =2, but I don't want that color for all customlistview....
 

Attachments

  • colorcustomlistview.zip
    10.5 KB · Views: 99
Upvote 0

mangojack

Well-Known Member
Licensed User
Longtime User
I have resized your Label (Layout 111) and reset the Panel/Item height when loading the CLV... (to same as your Label/Item height.)
 

Attachments

  • colorcustomlistview sample2.zip
    10.6 KB · Views: 99
Upvote 0

MroBurk

Member
Licensed User
Thank you so' much!!!!! Now I match the problem that is in the label's background.. If it's transparent ,The customlistview take a color of divider... So' the custumlistview can't have the background that I need??? Is there a solution to do this?
 
Upvote 0

mangojack

Well-Known Member
Licensed User
Longtime User
You can set the Item layout "Activity" Color ...
Another Option is to place all your Items on a colored Panel ...
 

Attachments

  • colorcustomlistview sample3.zip
    10.7 KB · Views: 105
Upvote 0

MroBurk

Member
Licensed User
I'm really grateful to you ! Thanks a lot! for your Help and your time!! @mangojack... I have to study another solution because although they are excellent solutions but they don't fully satisfy me... thanks again. The result is not natural as if there is a background....
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
Example.
Configuration of colors, height of the items, use of anchors and XUI variables.

Divider color:
B4X:
CustomListView1.sv.ScrollViewInnerPanel.Color = xui.Color_DarkGray

1643177306311.png
 

Attachments

  • colorcustomlistview1.zip
    10.6 KB · Views: 107
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Hi, I need help to set The Divider in Customlistview. If I select in a design view any colors and set the Height to "1", all customlistview is colored the same color I selected for the divider. Please help!!
I think that we didn't catch what you are trying to obtain.
Maybe something like an example image would help.
Or a better explanation. :)
 
Upvote 0

MroBurk

Member
Licensed User
@oparra thank you so much! My problem is set the divider and the background of customlistview like the first image "Cattura.PNG" below... the "second_img" is not good for my idea of mobile app... thanks
 

Attachments

  • Cattura.PNG
    Cattura.PNG
    17.5 KB · Views: 111
  • second_img.PNG
    second_img.PNG
    9.3 KB · Views: 105
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
My example.
I used 2 Labels in the layout of the item:
the first Label contain the text and the second one it's used to make the thin line (a Dirty Trick).
Check carefully the properties of the CustomListView in the Designer.
Hopefully this can be something near what you are searching for, it can be improved or better realized probably.
 

Attachments

  • CLV-Background.zip
    10.6 KB · Views: 104
Upvote 1

TILogistic

Expert
Licensed User
Longtime User
demo v2 post 14.

You can use more color combinations to generate the gradient.
the radius of the borders indicated in the layout of the CustomListView

see code and design.

note:
and if you want the version of post 13 let me know
 

Attachments

  • colorcustomlistview-v2.zip
    11 KB · Views: 102
Upvote 0

Mahares

Expert
Licensed User
Longtime User
gradientdrawable must be from the top to the bottom.
Why do you want to use this sub to generate the gradient Public Sub SetGradientBackground(pnl As B4XView, Clrs() As Int, Orientation As String), when you can do all of it via the designer. See layout2.bal file attached.

1643231502572.png
 

Attachments

  • layout2.bal
    2 KB · Views: 93
Upvote 0

MroBurk

Member
Licensed User
@Mahares because It doesn't work If I use only designview... this is what your layout show (1.1 & 1.2) and this is what I see if I set divider in designview (2.1 & 2.2).... That's the problem.... Maybe I'm wrong anythings...
 

Attachments

  • 1.1.PNG
    1.1.PNG
    95.8 KB · Views: 115
  • 1.2.PNG
    1.2.PNG
    11.1 KB · Views: 104
  • 2.2.PNG
    2.2.PNG
    43.5 KB · Views: 98
  • 2.1.PNG
    2.1.PNG
    14.3 KB · Views: 98
Upvote 0
Top