I would like a customized spinner which comes up when I click a link button. So I don't want to see the spinner value or icon V at all. Just click and the spinner pops up.
So 1) Does android have a link button. Or how could I use Button with just button label s开发者_运维技巧howing and now border seamless?
2) How do I bring up the spinner from the link button?
3) How do I catch the selected spinner value?
No, Android does not have a dedicated link button, but buttons can be styled and themed so you can certainly make them look as links:
Create custom button with
<selector>
to style different Button states (pressed/released).To make button transperent use:
android:background="@null"
Register a
Button.onClickListener()
so that when clicked a Dialog with a Spinner is opened:button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // Put code to show Dialog here } });
Register
spinner.onItemSelected()
handler as shown in the above link.
精彩评论