Getting resized images inside Android buttons -


I want to design a table layout with icons and some big buttons with text. I've got some similar questions but not the same. My Simplified XML layout is:

  & lt; Table layout xmlns: Android = "http://schemas.android.com/apk/res/android" android: orientation = "vertical" android: layout_width = "Fill_parent" Android: layout_height = "fill_parent" & gt; & Lt; TableRow Android: id = "@ + id / TableRow01" Android: gravity = "center" & gt; & Lt; Button Android: Text = "@ String / Telephone" Android: drawableTop = "@ drawable / phone" Android: id = "@ + id / button_phone" & gt; & Lt; / Button & gt; & Lt; Button Android: Text = "@ String / Help" Android: src = "@Drawable / Help" Android: id = "@ + id / button_help" & gt; & Lt; / Button & gt; & Lt; / TableRow & gt; & Lt; / TableLayout & gt;  

The icon picture is slightly larger, so I want to resize them to Android, but Android: the height parameter changes the size of the button, not the embedded image. Do you consider any of the "resizeable" buttons to get a button with text and image?

use the ScaleType attribute)
Edit: Support for many screen sizes with your designs If you actually follow the Android Convention instead of using large drawables for smaller screens and resizing them at runtime, you have better performance and fewer problems.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -