上一页 1 ··· 8 9 10 11 12 13 14 下一页
摘要: 当我们从一个Activity启动了一个Fragment,然后在这个Fragment中又去实例化了一些子Fragment,在子Fragment中去有返回的启动了另外一个Activity,即通过startActivityForResult方式去启动,这时候造成的现象会是,子Fragment接收不到OnA... 阅读全文
posted @ 2014-10-10 18:24 Michelle's Home 阅读(974) 评论(0) 推荐(0) 编辑
摘要: 大家都知道,可以通过使用 startActivityForResult() 和 onActivityResult() 方法来传递或接收参数。但你是否遭遇过onActivityResult()不执行或者未按预想的那样执行的情况呢?这里我总结了三种情况:1、执行startActivityForResul... 阅读全文
posted @ 2014-10-10 18:21 Michelle's Home 阅读(439) 评论(0) 推荐(0) 编辑
摘要: 1.可以将多个图片按照顺序层叠起来2.在drawable下建立一个xml文件 3.效果图+ = 阅读全文
posted @ 2014-10-10 18:14 Michelle's Home 阅读(447) 评论(0) 推荐(0) 编辑
摘要: 由于这两天在做listView的东西,所以整理出来一些我个人认为比较特别的属性,通过设置这样的属性可以做出更加美观的列表首先是stackFromBottom属性,这只该属性之后你做好的列表就会显示你列表的最下面,值为true和falseandroid:stackFromBottom="true" ... 阅读全文
posted @ 2014-10-10 18:12 Michelle's Home 阅读(167) 评论(0) 推荐(0) 编辑
摘要: android获取屏幕的高度和宽度用到WindowManager这个类,两种方法: 1、WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);int width = wm.ge... 阅读全文
posted @ 2014-10-10 18:11 Michelle's Home 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 当android的Edittext得到/失去焦点时,需要自定义一些处理内容时,需要对EditText对象的Focus进行监听处理。在Activity中,做以下处理:1.取得EditText对象。2.为取得的对象添加setOnFocusChangeListener(),重写里面的方法。如下:EditT... 阅读全文
posted @ 2014-10-10 18:10 Michelle's Home 阅读(325) 评论(0) 推荐(0) 编辑
摘要: 设置监听软键盘事件,有点 调用 clearFouse()方法,但是测试了都没有! xml中也找不到相应的属性可以关闭这个默认行为解决之道:在EditText的父级控件中找一个,设置成 android:focusable="true" android:focusableInTouchMode="... 阅读全文
posted @ 2014-10-10 18:09 Michelle's Home 阅读(382) 评论(0) 推荐(0) 编辑
摘要: try { Class argClass=mSearchView.getClass(); //指定某个私有属性 Field mSearchHintIconField = argClass.getDeclaredField("mSear... 阅读全文
posted @ 2014-10-10 18:07 Michelle's Home 阅读(2573) 评论(0) 推荐(0) 编辑
摘要: 有的时候做应用需要点击按钮时文字颜色也跟着变,松开后又还原,目前发现两种解决方案:第一用图片,如果出现的地方比较多,那么图片的量就相当可观;第二,也就是本文讲到的。废话少说,先贴图片,再上代码。正常效果:按下效果:先在values目录创建color.xml文件,在里面加入以下自定义颜色(注意不是用c... 阅读全文
posted @ 2014-09-29 17:11 Michelle's Home 阅读(1425) 评论(0) 推荐(0) 编辑
摘要: import android.app.Activity;import android.app.AlertDialog;import android.app.AlertDialog.Builder;import android.content.DialogInterface;import androi... 阅读全文
posted @ 2014-09-29 17:01 Michelle's Home 阅读(2551) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 下一页