Contextcontext;privateListlist;LayoutInflaterinflater;publicXialaDistanceAdapter(Contextcontext,Listlist){this.context=context;this.list=list;inflater...
分类:
其他好文 时间:
2014-07-18 14:02:29
阅读次数:
150
最近接触左右划屏,从网上搜了一些资料,学习了一下,觉得不错,总结一下。
效果图如下,可以实现左右划屏
先说一下思路:
1.创建一个.java文件,继承Fragment
2.创建onCreateView()方法
3.将主页面的布局放在onCreateView中
View view = inflater.infla...
分类:
其他好文 时间:
2014-07-13 00:18:30
阅读次数:
308
android系统定义了弹出框,支持我们自定义布局:
public AlertDialog getEditCustomDialog() {
LayoutInflater inflater = getLayoutInflater();
View view = inflater.inflate(R.layout.custom_message_rename, null);
AlertDi...
分类:
其他好文 时间:
2014-07-13 00:12:45
阅读次数:
349
/** * Inflater英文意思是膨胀,在Android中应该是扩展的意思吧。 LayoutInflater的作用类似于 * findViewById(),不同点是LayoutInflater是用来找layout文件夹下的xml布局文件,并且实例化...
分类:
其他好文 时间:
2014-07-07 15:49:55
阅读次数:
197
1.定义PopupWindow弹出与消失的两个动画文件,放在anim文件夹下popup_enter.xml popup_exit.xml 2.styles.xml文件中注册这两个动画效果 3.为创建的PopopWindow添加动画inflater = getLayo...
Inflater英文意思是膨胀,在Android中应该是扩展的意思吧。 LayoutInflater的作用类似于 findViewById(),不同点是LayoutInflater是用来找layout文件夹下的xml布局文件,并且实例化!而 findViewById()是找具体某一个xml下的具体 ...
分类:
移动开发 时间:
2014-07-03 10:26:09
阅读次数:
176
LayoutInflater作用是将layout的xml布局文件实例化为View类对象。获取LayoutInflater的方法有如下三种:LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT.....
分类:
其他好文 时间:
2014-06-30 21:43:06
阅读次数:
248
本文将介绍ListView和Inflater的使用,将接上一篇文章内容.一.什么是ListView?在android开发中ListView是比较常用的控件,ListView控件可使用四种不同视图显示项目,1.大(标准)图标2.小图标3.列表4.报表,比较常用的是列表的形式.ListItem对象可包含...
分类:
移动开发 时间:
2014-06-18 22:14:17
阅读次数:
354
在Android开发中为了inflate一个布局文件,大体有2种方式,如下所示:
// 1. get a instance of LayoutInflater, then do whatever you want
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOU...
分类:
移动开发 时间:
2014-06-17 16:42:35
阅读次数:
360
注:
1、引用了android.support.v4.app.*;包中的组件;
2、为了兼容android1.6,MainActivity继承于FrameActivity;
3、改代码中fragment已写入xml中,缺点是不能实现动态的增删,后面的学习将使用代码来进行添加删除fragment。
4、onCreateView方法中,inflater.inflate(R.layo...
分类:
其他好文 时间:
2014-06-15 18:12:33
阅读次数:
153