语言

ActionBar.SetCustomView 方法

定义

重载

名称 说明
SetCustomView(View, ActionBar+LayoutParams)

将操作栏设置为自定义导航模式,提供自定义导航的视图。

SetCustomView(Int32)

将操作栏设置为自定义导航模式,提供自定义导航的视图。

SetCustomView(View, ActionBar+LayoutParams)

将操作栏设置为自定义导航模式,提供自定义导航的视图。

[Android.Runtime.Register("setCustomView", "(Landroid/view/View;Landroid/app/ActionBar$LayoutParams;)V", "GetSetCustomView_Landroid_view_View_Landroid_app_ActionBar_LayoutParams_Handler")]
public abstract void SetCustomView(Android.Views.View? view, Android.App.ActionBar.LayoutParams? layoutParams);
[<Android.Runtime.Register("setCustomView", "(Landroid/view/View;Landroid/app/ActionBar$LayoutParams;)V", "GetSetCustomView_Landroid_view_View_Landroid_app_ActionBar_LayoutParams_Handler")>]
abstract member SetCustomView : Android.Views.View * Android.App.ActionBar.LayoutParams -> unit

参数

view
View

视图:要放置在 ActionBar 中的自定义导航视图。

layoutParams
ActionBar.LayoutParams

ActionBar.LayoutParams:此自定义视图在条形图中的布局方式。

特性

注解

将操作栏设置为自定义导航模式,提供自定义导航的视图。 自定义导航视图显示在应用程序图标和任何操作按钮之间,并可以使用任何可用空间。 自定义导航视图的常见用例可能包括浏览器的自动建议地址栏或其他无法很好地转换为提供的导航模式的导航机制。

必须设置显示选项DISPLAY_SHOW_CUSTOM才能显示自定义视图。

Android 参考。android.app.ActionBar.setCustomView

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

SetCustomView(Int32)

将操作栏设置为自定义导航模式,提供自定义导航的视图。

[Android.Runtime.Register("setCustomView", "(I)V", "GetSetCustomView_IHandler")]
public abstract void SetCustomView(int resId);
[<Android.Runtime.Register("setCustomView", "(I)V", "GetSetCustomView_IHandler")>]
abstract member SetCustomView : int -> unit

参数

resId
Int32

要膨胀到 ActionBar 的布局的资源 ID。

特性

注解

将操作栏设置为自定义导航模式,提供自定义导航的视图。 自定义导航视图显示在应用程序图标和任何操作按钮之间,并可以使用任何可用空间。 自定义导航视图的常见用例可能包括浏览器的自动建议地址栏或其他无法很好地转换为提供的导航模式的导航机制。

必须设置显示选项DISPLAY_SHOW_CUSTOM才能显示自定义视图。

Android 参考。android.app.ActionBar.setCustomView

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于