Update Height with ViewFlipper
Asked Answered
C

2

7

I want to be able to update height on every child of the ViewFlipper. Is this possible as I could never find any API documentation for ViewFlipper and updating the height or width.

Cecilececiley answered 6/8, 2011 at 6:2 Comment(0)
A
22

just use

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

It will take height, and width of visible child only

August answered 6/12, 2012 at 9:11 Comment(1)
Worked like a charm :)Generator
F
0

You're just going to have to loop through:

 LayoutParams myLP = new LayoutParams(myHeight, myWidth);
 for (int i = 0; i < myViewFlipper.getChildCount(); i++) {
      myViewFlipper.getViewAt(i).setLayoutParams(myLP);
 }
Furnary answered 20/9, 2011 at 1:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.