We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I tried creating a multiline_spinner_dropdown_item.xml And it contains:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" style="?android:attr/spinnerDropDownItemStyle" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" android:singleLine="false"/>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="?android:attr/spinnerDropDownItemStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:singleLine="false"/>
Then I called it here: EloadFragment.java
@Override public void onActivityCreated(final Bundle savedInstanceState){ super.onActivityCreated(savedInstanceState); final MaterialBetterSpinner spinnerDropdown1 = myView.findViewById(R.id.material_spinner); ArrayAdapter adapter1 = ArrayAdapter.createFromResource(myView.getContext(), R.array.spinner_smart, R.layout.multiline_spinner_dropdown_item); spinnerDropdown1.setAdapter(adapter1); spinnerDropdown1.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { Toast.makeText(myView.getContext(),"Selected: "+adapterView.getItemAtPosition(i),Toast.LENGTH_SHORT).show(); spinnerDropdown1.clearFocus(); } }); }
Sample output of the spinner: (The first item didn't wrap the long text)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I tried creating a multiline_spinner_dropdown_item.xml
And it contains:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="?android:attr/spinnerDropDownItemStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:singleLine="false"/>
Then I called it here:
EloadFragment.java
Sample output of the spinner: (The first item didn't wrap the long text)
![imageedit_4_7397778429](https://user-images.githubusercontent.com/34466229/33867224-1db47f82-df36-11e7-8be4-bce21c661c22.jpg)
The text was updated successfully, but these errors were encountered: