我需要创建一个带有矩形边框和三角形下拉箭头的微调器。如何创建这样的旋转器?我尝试过,但我的实际输出与预期输出不同。 这是预期的输出。
但是我的输出看起来像这样。
如何创建带有矩形框的下拉图像的微调器?
这是我应用的代码。
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="1dip"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Preferred contact method">
</TextView>
<Spinner
android:id="@+id/account_spinner"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginTop="2dp"
style="@style/Base.Widget.AppCompat.Spinner.Underlined"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Telephone">
</TextView>
<EditText
android:layout_width="match_parent"
android:layout_height="30dp"
android:inputType="phone"
android:ems="10"
android:background="@drawable/edittext_border"
android:id="@+id/editText" />
EditText边框.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#ffffff" />
<stroke
android:width="1dp"
android:color="#000000" />
但是如何申请带有三角形箭头和外矩形边框的微调器呢?
提前致谢。
最佳答案
它只是像 XML 布局预览中那样呈现,因为预览不知道您想要将哪些数据绑定(bind)到微调器。一旦您在设备或模拟器上运行它,它看起来就像一个带有下拉箭头的普通旋转器。
关于android - 如何创建带有三角形下拉箭头的矩形框的微调器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39050612/