我已实现了以下库飞旋在我的应用程序,即从XML我怎么能在MaterialBetterSpinner库
<com.weiwangcn.betterspinner.library.material.MaterialBetterSpinner
android:id="@+id/insurer_code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_insurer_code"
android:textColor="@color/smart_primary"
android:textColorHint="@color/input_register_hint"
app:met_floatingLabel="normal" />
和Java代码
public class testActivity extends Activity implements OnItemSelectedListener
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
Toast.makeText(adapterView.getContext(), "Selected: " , Toast.LENGTH_LONG).show();
// On selecting a spinner item
String item = adapterView.getItemAtPosition(i).toString();
// Showing selected spinner item
Toast.makeText(adapterView.getContext(), "Selected: " + item, Toast.LENGTH_LONG).show();
}
但onItemSelected没有火起来的时候实现onItemSelected从菜单中选择一个项目。将不胜感激关于如何成功实现上述库的任何指导。