1. 引入依賴
dependencies { ... compile 'com.sherlockshi.widget:sherlockspinner:1.0.2'}
2. 使用方法
2.1 像使用系統(tǒng)Spinner一樣,在XML文件中使用:
<com.sherlockshi.widget.SherlockSpinner android:id="@+id/sherlock_spinner" android:layout_width="match_parent" android:layout_height="wrap_content" app:lineColor="#00FF00" android:hint="Please Select..."/>
SherlockSpinner有以下屬性:
lineColor
: 設(shè)置底部橫線的顏色
同時支持使用代碼進行配置:mSherlockSpinner.setLineColor(0x00FF00);
由于SherlockSpinner繼承自 EditText
, 所以你可以使用EditText的其它屬性,例如gravity
、 textSize
、 textColor