开发者

Customized Spinner Link Button

开发者 https://www.devze.com 2023-02-11 20:49 出处:网络
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.

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

精彩评论

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