When the dimensions of the inner Panel of a ScrollView or HorizontalScrollView get changed, the following code needs to be used so that the Panel redraws itself:
But the original Java code for a PanelWrapper, which extends a ViewWrapper, already uses the requestLayout method:
Why does the requestLayout method in the original code work for all Views, but not for an inner Panel?
(I am aware of xCustomListView, but I would like to know why this code is not working properly).
B4X:
Dim jo As JavaObject = HSV.Panel
jo.RunMethod("requestLayout", Null)
But the original Java code for a PanelWrapper, which extends a ViewWrapper, already uses the requestLayout method:
Java:
public void setWidth(@Pixel int width) {
ViewGroup.LayoutParams lp = getLayoutParams();
lp.width = width;
requestLayout();
}
public void setHeight(@Pixel int height) {
ViewGroup.LayoutParams lp = getLayoutParams();
lp.height = height;
requestLayout();
}
Why does the requestLayout method in the original code work for all Views, but not for an inner Panel?
(I am aware of xCustomListView, but I would like to know why this code is not working properly).