TextView has several property android:drawablexxx, usually displaying an image around the surrounding text, but there is a hole in it where text and pictures may be misaligned.
Even if you set gravity or Layout_gravity=center, it has no effect.
Generally in the bottom of the app navigation bar, will use RadioButton to achieve. Radiogroup should be a linear layout that supports oratation properties that can be arranged horizontally or vertically.
Since it is the bottom navigation bar, generally set the landscape layout, and then each RadioButton the weight property is set to 1,layout_width set to Match_parent, and then
Setting the Button property to @null, or even setting the background property to empty or transparent, has no effect.
The code:
<linearlayout android:layout_width= "match_parent" android:layout_height= "Wrap_content" Android : orientation= "Horizontal" > <textview android:layout_width= "wrap_content" android:layout_ height= "Wrap_content" android:drawabletop= "? Android:attr/listchoiceindicatorsingle" android:text= "@ String/hello_world "/> <textview android:layout_width=" 0DP " android:layout_height=" Wrap_ Content " android:layout_weight=" 1 " android:drawabletop="? Android:attr/listchoiceindicatorsingle " android:text= "@string/hello_world"/> <textview android:layout_width= "100DP" Android : layout_height= "wrap_content" android:drawabletop= "? Android:attr/listchoiceindicatorsingle" android: text= "@string/hello_world"/> </LinearLayout>
See the above and the code, only the width is set to Wrap_content to center. Try to set gravity to center, and you'll be surprised.
Setting the center text is also left-aligned with the middle of the icon, too much pit.
I took all the attributes out of my confidence, and then I accidentally did not align them?
If it is a word with wrap unexpectedly also useless, add gravity this my word to the right point, do not add on the left point.
If you use a linear layout to install a imageview and TextView compiler also prompts you to use the TextView Drawablexx to implement ....
Androidのtextview's compounddrawable those pits