Martin Larsen Active Member Licensed User Longtime User Feb 26, 2018 #1 I need to reposition af CustomListView in code. There is a panel at the top of the activity which is only visible at some conditions, and I need to move and resize the CLV to expand the full area if that panel is not visible. The following code will only change the top of the CLV. The height is not affected. In other words, the top of the CLV is positioned correctly, but the CLV does not expand to fit the full view. Code: Copy If Panel1.Visible Then CLV.AsView.Top = Panel1.Height Else CLV.AsView.Top = 0 End If CLV.AsView.Height = Activity.Height - CLV.AsView.Top The strange thing is that I can only set a height that is less than the initial height. That works. But for some reason the CLV cannot be higher than designed. The height property itself does change if I check it with Log(), but visually there is no change. What do I do wrong?
I need to reposition af CustomListView in code. There is a panel at the top of the activity which is only visible at some conditions, and I need to move and resize the CLV to expand the full area if that panel is not visible. The following code will only change the top of the CLV. The height is not affected. In other words, the top of the CLV is positioned correctly, but the CLV does not expand to fit the full view. Code: Copy If Panel1.Visible Then CLV.AsView.Top = Panel1.Height Else CLV.AsView.Top = 0 End If CLV.AsView.Height = Activity.Height - CLV.AsView.Top The strange thing is that I can only set a height that is less than the initial height. That works. But for some reason the CLV cannot be higher than designed. The height property itself does change if I check it with Log(), but visually there is no change. What do I do wrong?
Martin Larsen Active Member Licensed User Longtime User Feb 26, 2018 #3 CLV does not have a height property. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 27, 2018 #4 Code: Copy CLV.GetBase.Height = NewHeight CLV.sv.Height = NewHeight If you are also changing the width, or it is a horizontal list, then you need to call Base_Resize as well. Upvote 0
Code: Copy CLV.GetBase.Height = NewHeight CLV.sv.Height = NewHeight If you are also changing the width, or it is a horizontal list, then you need to call Base_Resize as well.
Martin Larsen Active Member Licensed User Longtime User Feb 27, 2018 #5 Thanks, it works! Is .sv the underlying ScrollView? Upvote 0