Android Question Anchoring issues with custom listview

bluedude

Well-Known Member
Licensed User
Longtime User
Hi all,

I use fully anchored layouts which I load in a custom listview but anchoring does not work.

I have a layout with a back panel which anchors to the activity. On the panel are views which anchor to the panel. When I load this in a custom listview all views are gone out of sight. When I disable anchoring on the back panel and do .width=100%x it works but them my anchoring of views is lost.

Any fixes/suggestions for this?
 

bluedude

Well-Known Member
Licensed User
Longtime User
Hereby the sample. Probably the issue is the newPanel declaration? I'm creating a new panel and that one is added to the listview with a layout called frmTest.

Is there another way to do it?
 

Attachments

  • anchoring.zip
    10.9 KB · Views: 120
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Check the logs (in debug mode):

SS-2014-10-19_17.41.02.png


Note that it is a mistake to use 300 instead of 300dip as the item height.
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Right, thanks. Dip is a typo, I normally do that.

One additional question. I have this panel behind the button which is set to left 5 and right edge distance 5. However, on my phones right edge distance 5 is smaller compared to left 5. Is that correct? Basically the panel does not center on screen.
 
Upvote 0
Top