Comments (7)
Hi @Marcosmaliki the spinner dropdown/dialog/bottomsheet is triggered when the spinner is focused. Try to ensure that the spinner is not the only focusable view. For example you can try adding android:descendantFocusability="beforeDescendants"
, android:focusable="true"
and android:focusableInTouchMode="true"
to the spinner parent.
from materialspinner.
The solution proposed by @tiper saved me...
from materialspinner.
Thank you. Works perfectly
from materialspinner.
Hi @tiper this did not help
from materialspinner.
@githeyj Did you add the properties to the spinner itself or the parent?
from materialspinner.
@githeyj do you happen to use a ScrollView
as the top-parent layout? I was having the same problem:
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="beforeDescendants"
android:focusable="true"
android:focusableInTouchMode="true">
<LinearLayout
android:id="@+id/subItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.tiper.MaterialSpinner
android:id="@+id/spinner"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:hint="@string/hint_spinner"/>
</LinearLayout>
</ScrollView>
With this structure (I've got a lot more spinners), the focus automatically goes to the first item of the layout after I close the spinner (no matter if the first item is a Spinner or and EditText). If the first item is a Spinner I won't be able to close it, and if I click the third spinner, I can close it but it will automatically open the first one.
I wrap the ScrollView
in another layout (I use a CoordinatorLayout
) and now it works
from materialspinner.
Hi @tiper really awesome library you've created. I want to add country image flag and country code as fetched from api and add custom adapter in the material spinner and show it when item selected. I have successfully created the custom adapter showing bottom dialog with image flag and code but when I'm selecting one item its only text that showing in Materialspinner. please help.
from materialspinner.
Related Issues (20)
- Resizing and refreshing drawable when error is triggered. HOT 2
- Spinner Items Not Closing HOT 13
- Spinner selected item text display whole model HOT 1
- performClick() doesn't show Dropdown, Dialog or BottomSheet HOT 6
- Crash when adding @style/Widget.MaterialComponents.TextInputLayout.OutlinedBox HOT 1
- How do i implement style in java code programatically.I tried in two ways as below :
- How do i implement style in java code programatically. HOT 1
- Typeface for spinner's hint, floating label and ... HOT 4
- can not get latest version of the package HOT 1
- Spinner for image and text
- Custom adapter for Material spinner HOT 4
- spinnermode dropdown not showing items inside custom dialog
- Add support android:entries="@array/planets_array"
- Update to androidx HOT 2
- Text alignment
- Search in dropdown HOT 1
- Spinner shows package name HOT 2
- NPE when clearing selection if no adapter set
- How to set the text size of selected item? as custom XML file for spinner is not working
- Add support for search option using filterable when spinnerMode is Dialog
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from materialspinner.