Tuesday 15 June 2010

android - App Widget Layout warning -


The following layout is recommended for app widgets.

  & lt; FrameLayout Android: Layout_width = "match_parent" Android: layout_height = "match_parent" android: padding = "@ dimen / widget_margin" & gt; & Lt; LinearLayout Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: Orientation = "horizontal" Android: background = "@drawable / my_width_broadground" & gt; & Lt; / LinearLayout & gt; & Lt; / FrameLayout & gt;   

Naturally the eclipse alert is this drawing layout or its frameless parents are useless is that correct? What is the content of your widget, it really depends? Can you remove linear layout?

Do you need a linerlayout or framelayout to keep your content in proper condition? Nobody can answer your question with your question. But if this is a LinearLayout then it is similar to the layout given above:

  Android: Line_Layout Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: Orientation = "horizontal "Android: Layout_margin =" @ dimen / widget_margin "Android: background =" @drawable / my_witch_bagrund "& gt; & Lt; / LinearLayout & gt;   

Please note that instead of using padding I've added the layout_margin attribute because the background is defined as the padding which you define.

No comments:

Post a Comment