item中存在 ImageButton 等可以点击的组件,这会抢先获得ListView的焦点.
从而导致item点击失效
分类:
移动开发 时间:
2014-05-19 09:49:55
阅读次数:
201
原文出自:方杰|http://fangjie.sinaapp.com/?p=141转载请注明出处学习Android也有一段时间了,感觉大部分的Android应用都有很多类似的组件,所以就打算做了这样一个开源项目,目的是整合一些Android开发常用的组件Demo,方便以后项目中直接拿来用。git地址...
分类:
移动开发 时间:
2014-05-19 09:14:14
阅读次数:
390
Activity转场动画
Activity的转场动画是通过overridePendingTransition(int enterAnim, int exitAnim)实现的。
这个方法是API Level 5 加入的。 这个方法在startActivity(Intent)orfinish()之...
分类:
移动开发 时间:
2014-05-17 14:38:41
阅读次数:
327
在本节中,你会学到1、定义接口2、实现接口3、将消息传递给fragment为了重用Fragment UI
组件,在设计中你应该通过定义每一个fragemnt自己的layout和行为,让fragment的自包含和模块化。一旦你定义了这些可重用的Fragment,你可以通过Activity将它们关联起来...
分类:
其他好文 时间:
2014-05-17 14:31:03
阅读次数:
316
在activity中有时需要嵌套调用fragment,但嵌套调用往往带来视图的显示与预期的不一样或是fragment的切换有问题。在使用时要注意几点:
1、fragment中嵌套fragment,子fragment视图无法显示:
如下:
父fragment的.xml文件:
<LinearLayout xmlns:android="http://schemas.andro...
分类:
移动开发 时间:
2014-05-16 01:24:16
阅读次数:
367
在新的SDK每次创建activity时,会自动生成 public static class PlaceholderFragment extends Fragment
fragment模块,在该模块的基础上进行嵌套fragment代码如下:
public static class PlaceholderFragment extends Fragment {
static Fragmen...
分类:
移动开发 时间:
2014-05-15 23:19:23
阅读次数:
461
在Android中当我们需要在界面上显示列表内容,则要使用ListView控件。 本文主要介绍如何使用ListView控件来显示自己想要的内容。
本文的最终成果如下图所示,当用户点击ListView中的内容时,控制台将会输出相应的Item名字。
在layout当中,我们有两个xml文件,分别为 activity_main 和 simple_item 其中在 前者中创建了一个L...
分类:
其他好文 时间:
2014-05-15 20:28:46
阅读次数:
364
1、使用新建线程结合handler来更新UI线程中的 ListView,快速点击“刷新”,会出现下面的错误:
??
The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not mod...
分类:
其他好文 时间:
2014-05-15 02:30:17
阅读次数:
254
当scrollview中包含listView时,滑动的时候会出现问题。。最常见的问题是listview滑动不了。。。问题原因是在加载listview时它的高度应该按照adapter所绑定的数据来确定,而不是fill_parent或者是wrap_content...
项目中用到了就把它抽取出来做个记录
import android.view.View;
import android.view....
分类:
移动开发 时间:
2014-05-14 21:13:11
阅读次数:
433