android - Custom ArrayAdapter for a Spinner: drop down view not working properly -
i created custom arrayadapter
spinner
. difference is, shows images arraylist
of complex class instead of plain text. works far. images , radio buttons displayed desired. problem is, drop downwards view doesn't behave correctly: doesn't close on click , radio buttons clickable instead of whole view.
does has thought what's wrong? have implement kind of listener
in adapter
??
here's code of getdropdownview
method:
@override public view getdropdownview(int position, view convertview, viewgroup parent) { layoutinflater inflater=(layoutinflater) ctx.getsystemservice(context.layout_inflater_service); linearlayout view=(linearlayout)inflater.inflate(r.layout.spinnerimageitem, null); imageview iv=(imageview)view.getchildat(0); radiobutton rb=(radiobutton)view.getchildat(1); int iimageid=ctx.getresources().getidentifier( "f_"+funcs.get(position).getbitmapsetup(), "drawable", ctx.getpackagename()); if(loco.getfunction(iindex).equals(funcs.get(position))) rb.setchecked(true); iv.setimageresource(iimageid); return(view); }
set android:focusable="false"
in layout radio button.
android custom-controls spinner adapter
No comments:
Post a Comment