How to add a line at the bottom of spinner as like edittext in android

前端 未结 6 1869
时光说笑
时光说笑 2021-02-02 06:39

Hello I am making demo application in which i am using EditText in which a line appears at the bottom that is ok but it is not in case of spinner.

How this

6条回答
  •  梦毁少年i
    2021-02-02 06:57

    That line is what you write your input above. A spinner doesn't have that line because it is not a text input field. If you want to have a line below the spinner too, You could insert it below by faking it like this:

    
    
    
    
    
    
    
    
    
    

    Probably you need to play around with the margins a bit. Also notice that the black line is only in Android 5.0, and the whole layout will look a lot different on older Androids. If you only want to have to black line on Android 5.0, then you have to make a copy of the layout, and insert it in a directory called layout-v21, and have the other version in the default layout directory.

提交回复
热议问题