Android Question [Solved] Border and corner in CustomlistView.AddTextItem

asales

Expert
Licensed User
Longtime User
I want to create a list - like the example below - and the AddTextItem is very nice, because it adjust automatically the text.

My problem is create a border and a corner in this option.

Is possible or do I need create a new layout - with a panel and a label - load the text and adjust manually the height?

Thanks in advance for any tip.

 

TILogistic

Expert
Licensed User
Longtime User
Solution that may be useful.

padding and height settings.

B4X:
    For i = 0 To clv1.Size -1
        Dim item As CLVItem = clv1.GetRawListItem(i)
        item.Panel.GetView(0).GetView(0).As(Label).Padding = Array As Int (10dip, 10dip, 10dip, 0dip)
        item.Panel.GetView(0).GetView(0).As(Label).Height = item.Panel.GetView(0).GetView(0).As(Label).Height + 20dip
        clv1.ResizeItem(i, item.Panel.Height + 20dip)
        clv1.GetRawListItem(i).Panel.SetColorAndBorder(xui.Color_White, 2dip, xui.Color_DarkGray, 6dip)
    Next

or

B4X:
    For i = 0 To clv1.Size -1
        clv1.GetRawListItem(i).Panel.GetView(0).GetView(0).As(Label).Padding = Array As Int (10dip, 10dip, 10dip, 0dip)
        clv1.GetRawListItem(i).Panel.GetView(0).GetView(0).Height = clv1.GetRawListItem(i).Panel.GetView(0).GetView(0).Height + 20dip
        clv1.ResizeItem(i, clv1.GetRawListItem(i).Size + 20dip)
        clv1.GetRawListItem(i).Panel.SetColorAndBorder(xui.Color_White, 2dip, xui.Color_DarkGray, 6dip)
    Next

 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…