Android Question customlistview setlayoutanimated

Kiran Raotole

Active Member
Licensed User
Hii Expert

I designing CustomListView in my app.
I need it five different times and in five different look with other layout

I have issue with p.SetLayoutAnimated(0,0,0,60%x,35%x)

I am confuse about how to give width and height,
so is their is any way to get panel used height

also if i'm giving height width manually ,
it change in different resolution mobile.

Thanks in advance.
 

Kiran Raotole

Active Member
Licensed User
I'm creating it with designer and I have issue on setting height and width for that listview row
I used this command :
p.SetLayoutAnimated(0,0,0,60%x,35%x)

But i'm unable to found exact height and width of that designer / view
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
you can see the height in the designer, i think u do not want use %y
dip give u the same size at any device.

B4X:
Sub CreateListItem(Item As SinglePassword) As B4XView
    
    Dim p As B4XView = xui.CreatePanel("Row")
    #if B4J
        p.SetLayoutAnimated(0 ,0,0,600,30dip) 'how to use 100%x ???
    #Else If B4A
        p.SetLayoutAnimated(0 ,0,0,100%x,30dip)
    #End If
    p.LoadLayout("Row")
    
    LabelColumn1.Text = Item.Name
    LabelColumn2.Text = Item.User
    LabelColumn3.Text = Item.Mail
    LabelColumn4.Text = Item.Url
    
    Return p
    
End Sub
 
Upvote 0

Kiran Raotole

Active Member
Licensed User
I want correct percent of x,y to work in any handset properly according to layout

screen shot of my layout

I want exact row height and widht
in my image height is more than and horizontal anchor is not proper
 

Attachments

  • Screenshot_1534672398.png
    Screenshot_1534672398.png
    43.5 KB · Views: 288
Upvote 0

Kiran Raotole

Active Member
Licensed User
No. I want actually used height from top of my that layout designer file,
like my custom listview designer has three label, then I need height upto three label.
Is any command there that give me actual used height
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
my custom listview designer has three label, then I need height upto three label.
u can use .top .height property from labels or the variant size you set in the designer.
for a static layout i would drag one element into, size as needed and copy/paste this height.

in your case at static layout the top+height of the last label is your row height.
 
Upvote 0

Kiran Raotole

Active Member
Licensed User
I have a panel in that layout, i used :
B4X:
    Dim p As B4XView = xui.CreatePanel("")
   p.LoadLayout("m411_listview")
   p.SetLayoutAnimated(0,0,0,100%x,panel1.height)

But it show nothing. also give log Panel size is unknown. Layout may not be loaded correctly.
 
Upvote 0
Top