1

I am using a relative layout with height as wrap content . When i put a large drawable as its background,instead of taking the child height,the relative layout takes the height of the drawable,which is added as background. When i use color,there is no problem in height of the layout. How i can avoid the extra height of the background image?

Anu
  • 1,303
  • 3
  • 23
  • 38

1 Answers1

0
int width = child.getwidth(); 
int height = child.getheight();
RelativeLayout.LayoutParams parms = new RelativeLayout.LayoutParams(width, height);
myRelativelayout.setLayoutParams(parms);
Galmani
  • 71
  • 7