I have an imageview. I want its width to be fill_parent. I want its height to be whatever the width ends up being. For example:
Update: Sep 14 2017
According to a comment below, the percent support library is deprecated as of Android Support Library 26.0.0. This is the new way to do it:
See here
Deprecated:
According to this post by Android Developers, all you need to do now is to wrap whatever you want within a PercentRelativeLayout or a PercentFrameLayout, and then specify its ratios, like so