🔥XPopup2.0版本重磅来袭,2倍以上性能提升,带来可观的动画性能优化和交互细节的提升!!!功能强大,交互优雅,动画丝滑的通用弹窗!可以替代Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner等组件,自带十几种效果良好的动画, 支持完全的UI和动画自定义!(Powerful and Beautiful Popup for Android,can absolutely replace Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner. With built-in animators , very easy to custom popup view.)
用的2.1.16版本的AttachPopupView,用于显示屏蔽弹框,有些显示会超出界面该怎么解决? 1.代码一: private void shieldDialog(View view, int position) { if (!mAdapter.getData().isEmpty()) { HouseRecommendBean.ResDataBean bean = mAdapter.getData().get(position); new XPopup.Builder(getContext()) .atView(view) .hasShadowBg(true) // 是否需要黑色背景 .asCustom(new RecommendShieldWindow(getActivity(), mAdapter, position, bean)) .show(); } else { ToastUtils.showShort("获取服务数据异常"); } } 2.代码二: public class RecommendShieldWindow extends AttachPopupView implements View.OnClickListener {
// mAdapter.notifyItemRemoved(mPosition); ToastUtils.showLong("已收到反馈,将减少推荐类似内容"); dismiss(); } }); }
// LogUtils.d("1351 "+showUpToTarget); if (showUpToTarget) { mTopClose.setVisibility(View.GONE);//弹框在view的上面,隐藏上面的箭头,显示下面的箭头 mBottomClose.setVisibility(View.VISIBLE); } else { mTopClose.setVisibility(View.VISIBLE);//弹框在view的下面面,显示上面的箭头,隐藏下面的箭头 mBottomClose.setVisibility(View.GONE); } return showUpToTarget; }
}