Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created December 15, 2023 11:29
Show Gist options
  • Save codeforfun-jp/7ffec740afe0a0bd756160fe25121630 to your computer and use it in GitHub Desktop.
Save codeforfun-jp/7ffec740afe0a0bd756160fe25121630 to your computer and use it in GitHub Desktop.
How to use spinner
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:context=".MainActivity">
<Spinner
android:id="@+id/spinner"
android:layout_width="240dp"
android:layout_height="wrap_content"
android:entries="@array/fruit_list"
android:minHeight="48dp"
android:spinnerMode="dialog" />
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment