I'm trying to add an ImageView to a RadioGroup. Preferably as part of the RadioGroup but to the left of all of the RadioButtons that are inside the group. I can make it appear on the bottom by simply adding it as the last item, but I would like to get it to appear to the left.
See my code and a picture below.
Code for getting it to appear on bottom:
RadioGroup rg = (RadioGroup) currentLayout.findViewWithTag("rg" + fld_id);
errorImage = new ErrorImageView(this);
errorImage.setBackgroundResource(R.mipmap.redxsmall);
errorImage.setScaleX(0.8f);
errorImage.setScaleY(0.8f);
rg.addView(errorImage);
Picture:
Any help would be appreciated. Thank you.
RadioGroup
inherits from LinearLayout
. That means it only supports placing views below or right of each other.
If you want both you have to wrap your RadioGroup
inside another ViewGroup
, e.g. a RelativeLayout
.