you need to retreat from the lower right corner, but if you set any value to the bottom and right view, then nothing happens, and the indent goes only if you put top and left

RelativeLayout.LayoutParams paramsImageView = new RelativeLayout.LayoutParams( 80, 80); paramsImageView.setMargins(0,0,320,320); hintImageView.setLayoutParams(paramsImageView); 
  • Is hintImageView located in the lower right corner of your container? you can turn on the display of borders (developer options) and you will see whether there are indents in your ImageView or not. - Andriy Martsinkevych

1 answer 1

  paramsImageView.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE); paramsImageView.addRule(RelativeLayout.ALIGN_PARENT_END, RelativeLayout.TRUE);