custom spinner click doesn't work properly in android?
I use custom spinner in my android application but the spinner clickable
but just on border
of line and spinner not clickable on middle side on version greater than
3.0 and it is perfectly
work on version less than 3.0. one more problem is when spinner populates
the value that
value is not clickable on version greater than 3.0.
please anybody tell me why this happen.
following is the custom spinner.
my main spinner.xml
<Spinner
android:id="@+id/bldngSpnrBldng"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="3dp"
android:layout_marginRight="2dp"
android:background="@drawable/spinner_selectors"
android:prompt="@string/select_building"
android:spinnerMode="dropdown" />
Here what happen when i open graphical Layout then I encountered exception
like
Failed to parse file ....\res\drawable\spinner_selector_selected.xml
Failed to parse file ....\res\drawable\spinner_selectors.xml
Resouce id 0x1010081 is not of type STYLE (instead attr) Exception details
are logged in Window > Show View > Error Log
following is the spinner listener.
spinnerPhase.setOnItemSelectedListener((OnItemSelectedListener)
new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
........
}
spinner_selector_selected.xml for border line and spinner image at corner
of spinner.
<?xml version="1.0" encoding="utf-8"?>
<item>
<layer-list>
<item>
<shape>
<stroke android:width="2dp" android:color="@color/gray" />
<corners android:radius="4dp" />
<padding
android:bottom="3dp"
android:left="3dp"
android:right="3dp"
android:top="3dp" />
<solid android:color="@color/pressed_color"/>
</shape>
</item>
<item>
<bitmap
android:gravity="bottom|right"
android:src="@drawable/spinner_ab_default_new_theme_bs" />
</item>
</layer-list>
</item>
Thanks in Advance
No comments:
Post a Comment