implement the iOS round button in Android -
I'm trying to create an iOS round button in Android. As you can know, the Android button has a gray background While the iOS round button has a clear background, I should use the styles and themes to get it.
However, I do not know how to piece things together. Can someone please give some advice?
Thanks
No need for style or theme. The trick with the buttons on Android is to use a different image for each state, and then combines them with a selector xml. You can put something like this in your doozleable directory and refer to it as an image:
& lt; Selector xmlns: android = "http://schemas.android.com/apk/res/android" & gt; & Lt; Item android: state_window_focused = "false" Android: state_enabled = "true" android: drawable = "@ drawable / btn_default_small_normal" /> & Lt; Item android: state_window_focused = "false" Android: state_enabled = "false" android: drawable = "@ drawable / btn_default_small_normal_disable" /> & Lt; Item Android: state_pressed = "true" android: drawable = "@ drawable / btn_default_small_pressed" /> & Lt; Item android: state_focused = "true" Android: state_enabled = "true" android: drawable = "@ drawable / btn_default_small_selected" /> & Lt; Android Android: state_enabled = "true" android: drawable = "@ drawable / btn_default_small_normal" /> & Lt; Item Android: state_focused = "true" android: drawable = "@ drawable / btn_default_small_normal_disable_focused" /> & Lt; Item Android: Dragon = "@ Drable / Btn_default_smml_armel_adgable" /> & Lt; / Selector & gt; Then just set the background picture for this background. See for more information.
Comments
Post a Comment