仿微信右上角弹出框
1、利用popwindow实现
2、popwindow的位置居于右上角
新建,弹出popwindow:
/** 弹popwindow **/
tv = (TextView) findViewById(R.id.textView1);
view_pop = LayoutInflater.from(MainActivity.this).inflate(...
分类:
微信 时间:
2015-05-07 22:12:41
阅读次数:
741
ViewHolder.javapackage cn.edu.bzu.util;import android.content.Context;import android.util.SparseArray;import android.view.LayoutInflater;import androi...
分类:
其他好文 时间:
2015-05-03 13:13:59
阅读次数:
133
【ps:CommonAdapter基于ViewHolder工具类】CommonAdapter.javapackage cn.edu.bzu.util;import android.content.Context;import android.view.LayoutInflater;import an...
分类:
其他好文 时间:
2015-05-03 13:11:46
阅读次数:
146
LayoutInflater的inflate函数用法详解
LayoutInflater作用是将layout的xml布局文件实例化为View类对象。
获取LayoutInflater的方法有如下三种:
?
LayoutInflater
inflater=(LayoutInflater)context.getSyste...
分类:
其他好文 时间:
2015-05-03 10:41:12
阅读次数:
121
首先需要一个layout作为主界面,layout里面放一个viewpager作为容器盛放不同的页面。再建三个layout文件分别盛放三张图片 Activity里利用findViewByID找到viewpager容器 利用LayoutInflater获取一个inflater,通过inflater找到盛...
分类:
其他好文 时间:
2015-05-01 16:05:50
阅读次数:
330
在这一章咱们来分析一下聊天界面中消息的显示,MessageAdapter。
public MessageAdapter(Context context, String username, int chatType) {
this.username = username;
this.context = context;
inflater = LayoutInflater.from(c...
分类:
其他好文 时间:
2015-04-30 16:16:29
阅读次数:
150
在adapter中通过使用静态内部类(viewholder)缓存组件的引用来防止ListView刷新时重新LayoutInflater跟findViewById从而达到优化的目的。示例如下:@Override public View getView(final int position, Vi...
分类:
移动开发 时间:
2015-04-28 11:06:26
阅读次数:
137
我们知道,LayoutInflater是用来实例化整个布局文件,而MenuInflater是用来实例化Menu目录下的Menu布局文件的。传统意义上的菜单定义需要Override Activity的onCreateOptionsMenu,然后在里面调用Menu.add把Menu的一个个item加进来...
分类:
移动开发 时间:
2015-04-24 00:50:54
阅读次数:
187
LayoutInflater与findViewById的用法有很多可比较之处。如:他们都可以通过id返回View。LayoutInflater inflater = getLayoutInflater();View layout = inflater.inflate(R.layout.custom_...
分类:
移动开发 时间:
2015-04-24 00:46:15
阅读次数:
326
PopupWindow popupWindow = new PopupWindow(this); popupWindow.setContentView(LayoutInflater.from(this).inflate(R.layout.activity_main, null)); popu...