Android: Drawing a button as a spinner

前端 未结 5 1496
一生所求
一生所求 2020-12-15 05:39

I have a custom android view that extends \'Button\' and acts as a multi-level spinner - when it is pressed it displays a series of spinner-like dialogs that allow a user to

5条回答
  •  天涯浪人
    2020-12-15 06:06

    You can define the android:background attribute on your button to use a drawable that looks like the spinner. I did this by creating a 9-patch image for the spinner, putting it in my res/drawable folder, and then adding a style for my custom spinner button:

    
    

    For your button, add the style attribute to the XML layout for your layout:

提交回复
热议问题