03 2014 档案

摘要:1.自定义组件(按钮)xml文件如下 2.这个按钮有两个属性是变的,一个是图片,一个是文字,在res/values/attrs.xml文件自定义两个属性:text, icon ... 阅读全文
posted @ 2014-03-26 21:22 BaronZ 阅读(164) 评论(0) 推荐(0)
摘要:1.响应返回键/响应键盘事件(onKeyListener) 最近在做PopupWindow, 发现使用PopupWindow一出现,不会响应popup外面的事件,经过资料查找,发现有两种方法可以响应外部事件。/**只是要简单的响应返回事件,即点击返回键,popup消失,那只需设置popup的背景就... 阅读全文
posted @ 2014-03-25 17:18 BaronZ 阅读(384) 评论(0) 推荐(0)
摘要:Animations的分类Animations从总体上可以分为两大类:1.Tweened Animations:该类Animations提供了旋转、移动、伸展和淡出等效果。 Alpha——淡入淡出,Scale——缩放效果,Rotate——旋转,Translate——移动效果。2.Frame-by-... 阅读全文
posted @ 2014-03-21 19:40 BaronZ 阅读(405) 评论(0) 推荐(0)
摘要:代码如下:Intent intent = new Intent();intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);intent.setAction(android.content.Intent.ACTION_VIEW);intent.setDataAndType(Uri.fromFile(new File(filePath)), type);context.startActivity(intent);异常信息提示如下:03-20 16:46:48.760: E/AndroidRuntime(30325): android.content.Acti 阅读全文
posted @ 2014-03-20 17:01 BaronZ 阅读(5221) 评论(0) 推荐(0)
摘要:GridView代码:android:verticalSpacing="8dp"android:horizontalSpacing="8dp"说明:gridview每个格子之间的间隔(垂直,水平)140320:GridView, ListView更改点击背景gridView.setSelector(... 阅读全文
posted @ 2014-03-13 15:48 BaronZ 阅读(457) 评论(0) 推荐(0)
摘要:再次踩bug:遍历删除list(java.util.ConcurrentModificationException)使用List list = new ArrayList();for(Long l : list){ if(l == 5){ list.remove(l); }} for(int i=0; i list = new ArrayList();Iterator it = list.iterator();while(it.hasNext){ if(it.next() == 5){ it.remove();//注意此处不能用list.re... 阅读全文
posted @ 2014-03-11 11:44 BaronZ 阅读(556) 评论(0) 推荐(0)