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.
just use
ViewFlipper myflipper = (ViewFlipper)findViewById(R.id.myflipper);
myflipper .setMeasureAllChildren(false);
It will take height, and width of visible child only
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);
}
精彩评论