开发者

Update Height with ViewFlipper

开发者 https://www.devze.com 2023-03-26 02:45 出处:网络
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

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);
 }
0

精彩评论

暂无评论...
验证码 换一张
取 消