android 中这种类型的选项菜单叫什么?
What is this type of option menu called in android?
click to open image
它的名字和制作方法。
这称为自定义对话框。自定义对话框是通过扩展 Dialog
class 并通过这种方式使用您自己的布局来实现的:
class CustomDialog extends Dialog {
// default constructor
public CustomDialog(Activity activity) { // activity that runs your dialog
super(activity);
}
// default onCreate method
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// set your custom dialog layout here
setContentView(R.layout.custom_dialog_layout);
// your code here
}
}
click to open image
它的名字和制作方法。
这称为自定义对话框。自定义对话框是通过扩展 Dialog
class 并通过这种方式使用您自己的布局来实现的:
class CustomDialog extends Dialog {
// default constructor
public CustomDialog(Activity activity) { // activity that runs your dialog
super(activity);
}
// default onCreate method
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// set your custom dialog layout here
setContentView(R.layout.custom_dialog_layout);
// your code here
}
}