本文介绍了如何在微调框的底部添加一条线,例如android中的edittext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在制作演示应用程序,其中我使用的是 EditText ,其中在底部显示一行,但没有旋转器.

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.

这怎么可能?

layout.xml

layout.xml

<EditText
    android:id="@+id/twitterEditText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="15dp"
    android:hint="@string/twitter_account"
    android:inputType="textWebEmailAddress" />


<Spinner
    android:id="@+id/countrySpinner"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="15dp"
    android:hint="@string/country" />

<Spinner
    android:id="@+id/stateSpinner"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="15dp"
    android:hint="@string/state" />

<Spinner
    android:id="@+id/citySpinner"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="15dp"
    android:hint="@string/city" />

推荐答案

我只是遇到了同样的问题,经过一段时间的研究,答案很简单:

I just faced the same Problem and after researching for a while the answer is quite easy:

    <Spinner
        ...            
        style="@style/Widget.AppCompat.Spinner.Underlined"
        ... />

这篇关于如何在微调框的底部添加一条线,例如android中的edittext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 21:29