3.3学习总结

今天学了控件9PopupWindow

  View popupView = getLayoutInflater().inflate(R.layout.dialog_view,null);
PopupWindow popupWindow = new PopupWindow(popupView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,true); 设置PopupWindow显示的View x偏移,y偏移 是否获取焦点
popupWindow.setBackgroundDrawable(getResources().getDrawable(R.drawable.ic_launcher_background)); 设置背景
popupWindow.showAsDropDown(view,view.getWidth(),view.getHeight());
popupWindow.dismiss();    关闭弹窗
popupWindow.setAnimationStyle(int animationStyle); 设置加载动画
setTouchable(boolean touchable) 设置触摸使能
setOutside Touchable(boolean touchable) 设置PopupWindow外面的触摸使能
posted @ 2023-03-05 18:32  代不动码  阅读(8)  评论(0)    收藏  举报