iOS Question How to properly use the SizeToFit in a CustomListView?

Lucas Siqueira

Active Member
Licensed User
Longtime User
In CustomListView I add a panel,
Which has two label, lbl_name and lbl_number ... I want to add a name in lbl_name that sometimes will be 3 lines other than 1 line only, I wanted lbl_nome to take the correct size
And also that the lbl_number goes down as much as it takes to stay below the lbl_name.

Sorry for english, I used google translate.
 

Attachments

  • b4i - MeasureMultilineTextHeight no IOS 3.zip
    267.2 KB · Views: 226
  • WhatsApp Image 2017-04-28 at 19.43.20.jpeg
    WhatsApp Image 2017-04-28 at 19.43.20.jpeg
    92.6 KB · Views: 245

Emme Developer

Well-Known Member
Licensed User
Longtime User
B4X:
lbl_name.sizetofit
lbl_number.top = lbl_name.top + lbl_name.height
lbl_number.sizetofit
pnl.height = lbl_number.top + lbl_numer.heigt + 16dip 'Padding
 
Upvote 0

Lucas Siqueira

Active Member
Licensed User
Longtime User
[QUOTE = "Emme Developer, postagem: 500161, member: 94542"]
B4X:
 lbl_name.sizetofit
Lbl_number.top = lbl_name.top + lbl_name.height
Lbl_number.sizetofit
Pnl.height = lbl_number.top + lbl_numer.heigt + 16dip 'Padding [/ CODE] [/ QUOTE]

I did so in the source, but it does not work, how can you do in this source that I sent and post?
 
Upvote 0

Emme Developer

Well-Known Member
Licensed User
Longtime User
By the way, use this code in page resize. I got many issue when loading a layout and editing dimension after load. After some checks I see that in page resize dimension will get designer value, so after moving dimension editing in page resize event all works properly l. I hope this can help you
 
Upvote 0

Lucas Siqueira

Active Member
Licensed User
Longtime User
By the way, use this code in page resize. I got many issue when loading a layout and editing dimension after load. After some checks I see that in page resize dimension will get designer value, so after moving dimension editing in page resize event all works properly l. I hope this can help you

I could not make it work .. :(
 
Upvote 0
Top