Tuesday, 15 July 2014

android - Prevent layout to resize after background -


I

I'm setting up a backgound to RelativeLayout. The point is that the layout has been changed after the size of the image, which I do not want. I want to shape the layout after two text scenes.

Still layout to prevent the small size of the background?

This XML-code

  & lt; RelativeLayout android: id = "@ + id / HUD" Android: Layout_width = "Match_parent" Android: Layout_height = "Wrap_content" android: background = "@ + Drobl / Hud_bak Ground" Android: Leaut_vet = "1" & gt; & Lt; TextView android: id = "@ + id / lblScore" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" Android: layout_alignParentLeft = "true" Android: layout_centerVertical = "true" android: text = "Score:" / Gt; & Lt; TextView android: id = "@ + id / txtScore" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: layout_alignBaseline = "@ + id / lblScore" Android: layout_alignBottom = "@ + id / lblScore" Android: layout_toRightOf = "@ + id / lblScore" android: text = "00" / & gt; & Lt; / RelativeLayout & gt;   

Regards

I think all you need Android Android had to change: layout_width = Android "match_parent": layout_width = relativeLayout the "wrap_content for", so size will be according alone textViews

Why add :. Layout_weight = "1"? Is this just a part of your layout file?

If so, it is in a vertical linear Lyaut, so use it:

  android: layout_width = "match_parent" android: layout_height = "0px" < / code>  

and if it is in a horizontal linear layout, so use it:

  android: layout_width = "wrap_content" Android: layout_height = "0px" < / Code>   

No comments:

Post a Comment