Reminisce Active Member Jan 28, 2020 #1 I am trying to place the Love button below the label height after calculating the label.height using string utils's MeasureMultilinetextheight. Any idea on what to do?
I am trying to place the Love button below the label height after calculating the label.height using string utils's MeasureMultilinetextheight. Any idea on what to do?
Erel B4X founder Staff member Licensed User Longtime User Jan 29, 2020 #2 Where is the relevant code? Upvote 0
klaus Expert Licensed User Longtime User Jan 29, 2020 #3 LoveButton.Top = Label.Top + Label.Height You may need to check if the LoveButton is still in the screen area. Upvote 0
LoveButton.Top = Label.Top + Label.Height You may need to check if the LoveButton is still in the screen area.
Reminisce Active Member Jan 29, 2020 #4 @Erel and @klaus I fixed it with the code below.. Code: Dim minHeight As Int = su.MeasureMultilineTextHeight(lblfeedpost1,lblfeedpost1.Text) lblfeedpost1.Height = Max(50dip, minHeight) pnl.Height = lblfeedpost1.Height + 15%y Dim ItemHeight As Int =pnl.Height SetItemHeight(lvmenufeed,ItemHeight ,index,"",pnl) postenlarged = True buttonlike.Top = lblfeedpost1.Height + 7%y buttoncomment.Top = lblfeedpost1.Height + 7%y lblfeeddate1.Top = lblfeedpost1.Height + 7%y lbllike.Top = lblfeedpost1.Height + 7%y not sure if the highlighted code is the proper way to achieve this, but it works fine... Upvote 0
@Erel and @klaus I fixed it with the code below.. Code: Dim minHeight As Int = su.MeasureMultilineTextHeight(lblfeedpost1,lblfeedpost1.Text) lblfeedpost1.Height = Max(50dip, minHeight) pnl.Height = lblfeedpost1.Height + 15%y Dim ItemHeight As Int =pnl.Height SetItemHeight(lvmenufeed,ItemHeight ,index,"",pnl) postenlarged = True buttonlike.Top = lblfeedpost1.Height + 7%y buttoncomment.Top = lblfeedpost1.Height + 7%y lblfeeddate1.Top = lblfeedpost1.Height + 7%y lbllike.Top = lblfeedpost1.Height + 7%y not sure if the highlighted code is the proper way to achieve this, but it works fine...
klaus Expert Licensed User Longtime User Jan 29, 2020 #5 Without knowing your layout, it's not possible to say if your code is correct or not. The main point is that it works. Upvote 0
Without knowing your layout, it's not possible to say if your code is correct or not. The main point is that it works.
LucaMs Expert Licensed User Longtime User Jan 29, 2020 #6 https://www.b4x.com/android/forum/threads/b4x-xui-viewpos-source-code.92820/#content Upvote 0
Reminisce Active Member Jan 29, 2020 #7 Okay, thank you sir. klaus said: Without knowing your layout, it's not possible to say if your code is correct or not. The main point is that it works. Click to expand... us.. Upvote 0
Okay, thank you sir. klaus said: Without knowing your layout, it's not possible to say if your code is correct or not. The main point is that it works. Click to expand... us..