Android弹窗页面的三种实现方式

1.AlertDialog设置自定义view

2.自定义Dialog控件

3.PopupWindow

最简单的AlertDialog设置view

LayoutInflater inflater = LayoutInflater.from(getApplication());
View view = inflater.inflate(R.layout.dialog_item01, null);
AlertDialog.Builder builder=new AlertDialog.Builder(MainActivity.this);
builder.setView(view);
AlertDialog dialog=builder.create();
dialog.show();

AlertDialog细节:大小和位置的设置,取得内部控件实例

https://blog.csdn.net/yh18668197127/article/details/84975023

自定义Dialog步骤请看我的另一篇博客

https://blog.csdn.net/yh18668197127/article/details/84982630

PopupWindow的用法请看我的另一篇博客

https://blog.csdn.net/yh18668197127/article/details/84985307

猜你喜欢

转载自blog.csdn.net/yh18668197127/article/details/85112382