进入:
<?xml version="1.0" encoding="utf-8"?> 退出 <?xml version="1.0" encoding="utf-8"?> 动画的style在指定的位置显示
//显示窗口
window.showAtLocation(MainActivity.this.findViewById(R.id.main), Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL, 0, 0); //设置layout在PopupWindow中显示的位置
使用Dialog完成:
定义style
动画: 和popupwindow一致
自定义Dialog:
/**
- 选择图片对话框
- Created by chenlijin on 2016/4/12.
*/
public class SelectPicDialog extends Dialog {
public SelectPicDialog(Context context, int themeResId) {
super(context, themeResId);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dialog_select_pic);
ButterKnife.bind(this);</