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:
To set your ImageView equal to half the screen, you need to add the following to your XML for the ImageView:
To then set the height equal to this width, you need to do it in code. In the getView method of your GridView adapter, set the ImageView height equal to its measured width:
mImageView.getLayoutParams().height = mImageView.getMeasuredWidth();