ActionBar Question

牟恺
2023-12-01

1.android:actionViewClass="android.widget.SearchView",

SearchView

SearchView extends LinearLayout implements CollapsibleActionView

and,

CollapsibleActionView is a interface I think, and has two abstract method: onActoinViewCollapsed() and onActionViewExpanded().

CollapsibleActionView's description:

When a View implements this interface it will receive callbacks when expended or collapsed as an action view alongside the optional, app-specified callbacks to MenuItem.onActionExpendListener.

That is,

android:actionViewClass only allows one widget class to use.


2.andorid:actionProviderClass="andorid.widget.ShareActionProvider"

ShareActionProvider

ShareActionProvider extends ActionProvider

and,

ActionView has two direct subclasses: MediaRouteActionProvider and ShareActionProvider.

That is,

android:actionViewClass only has one common widget class to use.


Unless, Customize View extends or implements corresponding class.





 类似资料:

相关阅读

相关文章

相关问答