How can specific the layout_width and layout_height of a Framelayout which fits an image

Posted by michael on Stack Overflow See other posts from Stack Overflow or by michael
Published on 2010-04-28T06:05:29Z Indexed on 2010/04/28 6:13 UTC
Read the original article Hit count: 147

Filed under:

Hi,

I have an image which is 80px X 50 px, and I need to place that in one of the child of a FrameLayout, how can I specific the layout_width and layout_height of a Framelayout which fits an image without scaling it?

I know there is a layout_height="wrap_content" layout_wight="wrap_content" for FrameLayout, but I can't use it, since that FrameLayout has other children. So I would like to hard code the FrameLayout width/height to match the dimension of the image?

Should I use layout_width="80px" or layout_width="80dip"?

Thank you.

© Stack Overflow or respective owner

Related posts about android