Android buttons with text shadow and android shadow
<? Xml version = "1.0" encoding = "UTF-8"?> <LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" android: layout_width = "match_parent" android: layout_height = "match_parent" android: orientation = "vertical"> <! -- Text shadow Button --> <Button android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "text shadow Button" android: textSize = "12sp" android: shadowColor = "# aa5" android: shadowRadius = "1" android: shadowDx = "5" android: shadowDy = "5"/> </LinearLayout>
Android: How to center text under a button?
Add a horizontal center property under TextView: android: layout_centerHorizontal = "true"
<LinearLayout
Android: layout_width = "match_parent"
Android: layout_height = "match_parent"
Android: orientation = "horizontal">
<RelativeLayout
Android: layout_width = "0dp"
Android: layout_height = "wrap_content"
Android: layout_weight = "1">
<Button
Android: id = "@ + id/btn1"
Android: layout_width = "wrap_content"
Android: layout_height = "wrap_content"
Android: layout_centerHorizontal = "true"/>
<TextView
Android: layout_width = "wrap_content"
Android: layout_height = "wrap_content"
Android: layout_below = "@ id/btn1"
Android: layout_centerHorizontal = "true"
Android: text = "aaaaaa"/>
</RelativeLayout>
<RelativeLayout
Android: layout_width = "0dp"
Android: layout_height = "wrap_content"
Android: layout_weight = "1">
<Button
Android: id = "@ + id/btn2"
Android: layout_width = "wrap_content"
Android: layout_height = "wrap_content"
Android: layout_centerHorizontal = "true"/>
<TextView
Android: layout_width = "wrap_content"
Android: layout_height = "wrap_content"
Android: layout_below = "@ id/btn2"
Android: layout_centerHorizontal = "true"
Android: text = "bbbbbbb" & # ...... remaining full text>
In android development, why are these attributes set for text on my image buttons not centered?
The code is okay. It may be. 9. the area to be displayed in the image is not long-width symmetric. I used to encounter this problem. You can change it. if the problem is solved, it must be. why is the image