开发者

Set height of Flex Accordion to height of tallest child

开发者 https://www.devze.com 2022-12-25 12:57 出处:网络
By default the height of an Flex Accordion container is the height of the initially selected child.I\'d like to be able to set the height to the tallest child so that no resizing or scrolling is neces

By default the height of an Flex Accordion container is the height of the initially selected child. I'd like to be able to set the height to the tallest child so that no resizing or scrolling is necessary when other children are selected.

I do not want to use the resizeToContent property. I want the size of the container to stay constant no matter what child is selected.

My current thought is to extend the accordion class setting the creation policy to "al开发者_如何转开发l" and then override the measure function to loop through all the children and find the tallest one and use that for the height. This seems a little kludgy though, so I'd like to know if there is a better approach.

Ultimately my question is: is there a way to set the size of an accordion container such that the container never resizes and scoll bars are never necessary to display any of the children?


IMO your idea is probably the best way to go, one problem with it though, you're still going to have a scroll bar since it will set the height to the child and not take into account the chrome of the accordion. So you will need to add additional height for each header of the accordion.

Simple to figure out the header height and multiply it by the number of children, but still something you should keep in mind.

0

精彩评论

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