Most visited

Recently visited

BottomSheetDialog

public class BottomSheetDialog
extends AppCompatDialog

java.lang.Object
   ↳ android.app.Dialog
     ↳ android.support.v7.app.AppCompatDialog
       ↳ android.support.design.widget.BottomSheetDialog


基本类为 Dialog的样式作为底部表单。

Summary

Inherited constants

From interface android.content.DialogInterface

Public constructors

BottomSheetDialog(Context context)
BottomSheetDialog(Context context, int theme)

Protected constructors

BottomSheetDialog(Context context, boolean cancelable, DialogInterface.OnCancelListener cancelListener)

Public methods

void setContentView(View view)

将屏幕内容设置为明确的视图。

void setContentView(int layoutResId)

从布局资源中设置屏幕内容。

void setContentView(View view, ViewGroup.LayoutParams params)

将屏幕内容设置为明确的视图。

Protected methods

void onCreate(Bundle savedInstanceState)

onCreate(Bundle)类似,您应该使用此方法初始化对话框,包括调用 setContentView(View)

Inherited methods

From class android.support.v7.app.AppCompatDialog
From class android.app.Dialog
From class java.lang.Object
From interface android.support.v7.app.AppCompatCallback
From interface android.content.DialogInterface
From interface android.view.Window.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.View.OnCreateContextMenuListener

Public constructors

BottomSheetDialog

BottomSheetDialog (Context context)

Parameters
context Context

BottomSheetDialog

BottomSheetDialog (Context context, 
                int theme)

Parameters
context Context
theme int

Protected constructors

BottomSheetDialog

BottomSheetDialog (Context context, 
                boolean cancelable, 
                DialogInterface.OnCancelListener cancelListener)

Parameters
context Context
cancelable boolean
cancelListener DialogInterface.OnCancelListener

Public methods

setContentView

void setContentView (View view)

将屏幕内容设置为明确的视图。 该视图直接放置在屏幕的视图层次结构中。 它本身可能是一个复杂的视图层次结构。

Parameters
view View: The desired content to display.

setContentView

void setContentView (int layoutResId)

从布局资源中设置屏幕内容。 资源将被夸大,将所有顶级视图添加到屏幕上。

Parameters
layoutResId int: Resource ID to be inflated.

setContentView

void setContentView (View view, 
                ViewGroup.LayoutParams params)

将屏幕内容设置为明确的视图。 该视图直接放置在屏幕的视图层次结构中。 它本身可能是一个复杂的视图层次结构。

Parameters
view View: The desired content to display.
params ViewGroup.LayoutParams: Layout parameters for the view.

Protected methods

onCreate

void onCreate (Bundle savedInstanceState)

onCreate(Bundle)类似,您应该使用此方法初始化对话框,其中包括调用 setContentView(View)

Parameters
savedInstanceState Bundle: If this dialog is being reinitialized after a the hosting activity was previously shut down, holds the result from the most recent call to onSaveInstanceState(), or null if this is the first time.

Hooray!