Android Question what's my mistake ?

khosrwb

Active Member
Licensed User
Longtime User
what is my mistake ?
when I run this code
you can see for first image in true size but you can't see last image in true size
 

Attachments

  • what is my mistake.zip
    6.8 KB · Views: 107

DonManfred

Expert
Licensed User
Longtime User
Something like....

Optimizeable i guess :D

B4X:
Sub Activity_Create(FirstTime As Boolean)
    sc.Initialize(21%y*((187/4)+1))
    Dim innerheight = 0
    Activity.AddView(sc,0,0,100%x,100%y)
        For i = 0 To 187
            im.Initialize("imageview")
            im.Color = Colors.Red
            la.Initialize("label")
            la.Gravity = Gravity.CENTER
            la.Color = Colors.DarkGray
            la.TextColor = Colors.Blue
            la.Text = "this is image text"
            p = (DipToCurrent(i/4)) / 2
            top = p * 20%y
            top1 = (p * 6%y) +((p+1)*14%y)
            left = ( i mod 4 )* 24%x
            sc.Panel.AddView(im,left,top,22%x,14%y)
            sc.Panel.AddView(la,left,top1,22%x,6%y)
            innerheight = top + im.Height + la.Height
            sc.Panel.Height = innerheight
        Next
End Sub
 
Upvote 0
Top