8

Android not properly updating width of custom view

view full story
linux-howto

http://stackoverflow.com – I have this container class that is used to make one of the dimensions, either the width or height, a ratio of the other dimension. For instance, I want a 16:9 layout container where the width is "match_parent". However, when using the height as "match_parent", Android does not seem to properly relayout itself. When I set the height to be a ratio of the width everything is fine! Vise versa and it doesn't work. What's going on? public class RatioFrameLayout extends FrameLayout { private int useDimenToScale = -1; private float ratio = 1.6222f; // 4 x 3 default. 1.78 is 16 x 9 public float ge (HowTos)