Refresh Height with ViewFlipper

I want to be able to update the height for each child of the ViewFlipper. Is this possible, since I could never find the API documentation for ViewFlipper and update the height or width.

+6
source share
2 answers

just use

ViewFlipper myflipper = (ViewFlipper)findViewById(R.id.myflipper); myflipper .setMeasureAllChildren(false); 

It will occupy the height and width of only the visible child

+19
source

You just need to go through:

  LayoutParams myLP = new LayoutParams(myHeight, myWidth); for (int i = 0; i < myViewFlipper.getChildCount(); i++) { myViewFlipper.getViewAt(i).setLayoutParams(myLP); } 
0
source

Source: https://habr.com/ru/post/894431/


All Articles