List Item Layout Design/Style in Spinner

List Item Layout Design/Style in Spinner

<CheckedTextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:text="CheckedTextView"
    android:id="@+id/checkedTextView1"
    style="?android:attr/spinnerDropDownItemStyle"
    android:background="@drawable/gradient_background_clickable"
    android:textColor="@drawable/text_color_changeable"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight">
</CheckedTextView>


gradient background
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/gradient_background" android:state_pressed="true" />
    <item android:drawable="@drawable/gradient_background_reverse_color" />
</selector>

gradient background xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >
    <!-- You can also set gradient or just a simple color -->
            <gradient android:angle="90"
               android:endColor="#33B5E5"
               android:startColor="#002E3E" />
    </shape>

gradient background reverse color xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >
    <!-- You can also set gradient or just a simple color -->
            <gradient android:angle="90"
               android:endColor="#002E3E"
               android:startColor="#33B5E5" />
    </shape>

text color
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
     <item android:color="@color/white"  android:state_pressed="true"/>
     <item android:color="@color/black" />
 </selector>


Bu blogdaki popüler yayınlar

About Android padding, margin, width, height, wrap_content, match_parent, R Class

@SerializedName and @Expose annotations