简体   繁体   English

单击jaredrummler微调器中的按钮时如何清除微调器?

[英]How to clear spinner when click a button in the jaredrummler spinner?

how to clear spinner values in this spinner library when a button clicked. 单击按钮时如何清除此微调器库中的微调器值。

      <com.jaredrummler.materialspinner.MaterialSpinner
            android:id="@+id/et_amounts"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:background="@null"
            android:ems="10"
            android:layout_marginTop="55dp"
            android:inputType="number"
            app:layout_constraintStart_toStartOf="@+id/guideline2"
            app:layout_constraintTop_toBottomOf="@+id/et_receiptdate" />

you can set the following sample in the button click listener. 您可以在按钮单击侦听器中设置以下示例。

materialspinner.setItems(""); materialspinner.setItems(“”);

You have called spinner2List.clear(); 您已调用spinner2List.clear();。 but haven't notified the adapter by using notifyDataSetChanged(); 但尚未通过使用notifyDataSetChanged()通知适配器。 method. 方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM