开发者

Customized Spinner Link Button

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?


  1. 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"
    
  2. 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
         }
     });
    
  3. Register spinner.onItemSelected() handler as shown in the above link.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜