Hello comrades
I have a small problem. Look. If I change background (on my own) for
any button instance the text becomes out on left-top corner. How to
back text drawing on the centre on button with custom background? here
is my example. if I use the following code:
Button btnTicket = new Button(getContext());
btnTicket.setBackgroundResource(R.drawable.btn_green);
where the btn_green is a draw. resource :
<selector android:id="@+id/btn_green"
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false"
android:state_enabled="true" android:drawable="@drawable/
btn_green_normal"></item>
<item android:state_window_focused="false"
android:state_enabled="false" android:drawable="@drawable/
btn_green_normal_disable"/>
<item android:state_pressed="true" android:drawable="@drawable/
btn_green_pressed"/>
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/btn_green_selected"/>
<item android:state_enabled="true" android:drawable="@drawable/
btn_green_normal"/>
<item android:state_focused="true" android:drawable="@drawable/
btn_green_normal_disable_focused"/>
<item android:drawable="@drawable/btn_20_rnd_normal_disable"/>
</selector>
After adding this button of view activity I see that the text of it is
on left-top corner.
Does anybody face with it?
Thank you.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en