Android实现微信弹出框效果
来源:互联网 发布:电脑部分软件乱码 编辑:程序博客网 时间:2024/06/05 20:19
Android实现微信弹出框效果
1.选上图
2. 是用pupwindow实现,由于是在RecyclerView中显示的,需要测量当前imageButton所在位置 具体实现代码:
在代码中调用
ibComment.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { showMore(ibComment); }});
pupwindow 实现类
private void showMore(View BtnView) { if (mMorePopupWindow == null) { LayoutInflater li = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View content = li.inflate(R.layout.comment_layout, null, false); mMorePopupWindow = new PopupWindow(content, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); mMorePopupWindow.setBackgroundDrawable(new BitmapDrawable()); mMorePopupWindow.setOutsideTouchable(true); mMorePopupWindow.setTouchable(true); content.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); mShowMorePopupWindowWidth = content.getMeasuredWidth(); mShowMorePopupWindowHeight = content.getMeasuredHeight(); Log.i(TAG, "showMore: " + mShowMorePopupWindowHeight); Log.i(TAG, "showMore: " + mShowMorePopupWindowWidth); View parent = mMorePopupWindow.getContentView(); TextView like = (TextView) parent.findViewById(R.id.tv1); TextView comment = (TextView) parent.findViewById(R.id.tv2); } if (mMorePopupWindow.isShowing()) { mMorePopupWindow.dismiss(); } else { int heightMoreBtnView = BtnView.getHeight(); mMorePopupWindow.showAsDropDown(BtnView, -mShowMorePopupWindowWidth, -(mShowMorePopupWindowHeight + heightMoreBtnView) / 2); }}
阅读全文
1 0
- Android实现微信弹出框效果
- Android高效率实现弹出带动画效果的对话框,仿照微信对话框效果
- Android微信右上角弹出的对话选择框实现
- Android微信右上角弹出的对话选择框实现
- swift实现ios类似微信输入框跟随键盘弹出的效果
- Swift 实现 iOS 类似微信输入框跟随键盘弹出的效果
- 1. 实现微信形式的键盘与操作框的弹出收入效果
- swift实现ios类似微信输入框跟随键盘弹出的效果
- swift实现ios类似微信输入框跟随键盘弹出的效果
- android 实现微信的开门效果
- android 实现微信聊天界面效果
- 微信“+”的弹出窗口效果
- android自定义dialog实现下拉弹出框效果
- android 弹出框菜单效果
- Android 缩略图点击弹出大图效果实现
- Android实现人人网点击“+”弹出效果
- Android实现人人网点击“+”弹出效果
- Android实现人人网点击“+”弹出效果
- 单身是最好的增值时期
- 各种解析度的水平及垂直参数的参考设置
- SQL Server 中关于EXCEPT和INTERSECT的用法
- Error: L6406E: No space in execution regions with .ANY selector matching
- 第七周项目1---建立顺序环形队列算法库
- Android实现微信弹出框效果
- c++对c语言上的增强
- 数据结构——线性表(一)线性表的顺序存储和单链表
- ubuntu16.04服务器开发环境搭建
- 拉格朗日多项式逻辑回归分类算法
- MySQL:索引工作原理
- 深入理解javascript原型和闭包
- angularjs+生成随机数猜数字大小
- Ubuntu14.04的Python问题汇总