![]() We have full control of its UI! I chose ListView, could be anything else! All rendered by layout_country_dropdown.xml. So here we handle the dropdown view by ourselves. The magic of adding a header will be done in our CountryAdapter class:ĬountryAdapter.kt class CountryAdapter( context: Context ) : ArrayAdapter(context, 0, OperatedCountry.values()) With property android:background we can add a blue outline when Spinner is in the selected state and with android:popupBackground the background of dropdown view - easy so far. Thanks to we can see in Android Studio Designer how the Spinner will look like and adjust paddings/margins properly :) In this way, we’ve just built a Spinner widget on our UI. OK, so let’s begin with implementing the layout: ![]() Is it possible to implement using Spinner Widget? Let’s see. ![]() So the design for selection was not looking like a default Android Spinner as it had a header included when going to dropdown mode. Spinner Design ||| Spinner Design - dropdown ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |