Listview bitmap alignment

CidTek

Active Member
Licensed User
Longtime User
Listview1.TwoLinesAndBitmap.ImageView.Gravity=Gravity.RIGHT

I thought the above would place the bitmap at the right side of the listview but it's not working. Am I missing something?
 

splatt

Active Member
Licensed User
Longtime User
I thought that the bitmap.gravity controls position within an imageview, not the list.
 
Upvote 0

CidTek

Active Member
Licensed User
Longtime User
That is correct.

You should change the Left and Top properties to change its position.

Are you saying that if I take the Listview.width minus the Imageview.width, then that would give me the Imageview Left position that I then assign to the Imageview Left and Right property to ensure right margin alignment?

The Listview is set to 100%x and I want the icon aligned along the right margin in each row.

Do I have to reassign this for every row or just once?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Are you saying that if I take the Listview.width minus the Imageview.width, then that would give me the Imageview Left position that I then assign to the Imageview Left and Right property to ensure right margin alignment?
You should do that for the Left property (there is no Right property).

Do I have to reassign this for every row or just once?
Only once. All rows inherit the "model" layout.
 
Upvote 0

LittleEddie

Member
Licensed User
Longtime User
Here's how I moved it

lvSongs.FastScrollEnabled = False
lvSongs.TwoLinesAndBitmap.ImageView.Left = lvSongs.Width - 100
lvSongs.TwoLinesAndBitmap.Label.Left = 0
lvSongs.TwoLinesAndBitmap.SecondLabel.Left = 0
lvSongs.TwoLinesAndBitmap.Label.Width = lvSongs.Width - 100
lvSongs.TwoLinesAndBitmap.SecondLabel.Width = lvSongs.Width - 100
 
Upvote 0

LittleEddie

Member
Licensed User
Longtime User
I did better, I moved it to after I make the Bitmap so I know it's size and then used part of the Bitmap.width.

But yes, I will remember that in the future
 
Upvote 0
Top