android - Spinner with default icon + arrow -
assuming spinner
, how set default icon?
currently, mine shows icon of first item (bluetooth)
i believe specific example shareactionprovider
, special sublcass of actionprovider
if adding actionprovider
in xml menu can treat menu item , add icon.
from actionprovider
documentation:
<item android:id="@+id/my_menu_item" android:title="title" android:icon="@drawable/my_menu_item_icon" android:showasaction="ifroom" android:actionproviderclass="foo.bar.someactionprovider" />
since haven't used these don't know enough know if actionprovider
s have spinner corner triangle... guess yes?
upadte:
i thinking how spinneradapter
works , there way this. if using custom subclass of spinneradapter
in spinner
have 2 methods , following:
@override public view getdropdownview(int position, view convertview, viewgroup parent) { // return view display when looking @ dropdown, // textview and/or imageview } @override public view getview(int position, view convertview, viewgroup parent) { // show when item @ provided position // selected. @ point return imageview want // appear @ top, such share icon. }
Comments
Post a Comment