上一页 1 ··· 152 153 154 155 156 157 158 159 160 ··· 340 下一页
摘要: 方式一: 已将图片保存到drawable目录下,通过图片id获得Drawable或者Bitmap,此方式最常用。(若只知道图片的名称,还可以通过图片的名称获得图片的id) (1)通过图片id获得Drawable Drawable drawable=getResource().getDrawable( 阅读全文
posted @ 2016-06-29 09:55 星辰之力 阅读(5085) 评论(0) 推荐(0)
摘要: LayoutInflater inflater=(LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view=inflater.inflate(R.layout.view_dialog, null); 阅读全文
posted @ 2016-06-29 09:25 星辰之力 阅读(494) 评论(0) 推荐(0)
摘要: 在AlertDialog中使用自定义的View,如果View中有EditText,在上面点击,默认是跳不出软键盘的,不是焦点的问题。解决方法,有两种,一是把AlertDialog换成Dialog,但这么一来,对话框的最外层会多出一个框,顶部还会空几十个DP,当然可以用setBackgroundDra 阅读全文
posted @ 2016-06-28 16:58 星辰之力 阅读(4905) 评论(0) 推荐(0)
摘要: android 让一个控件按钮居于底部的几种方法1.采用linearlayout布局:android:layout_height="0dp" <!-- 这里不能设置fill_parent -->android:layout_weight="1" <!-- 这里设置layout_weight=1是最关 阅读全文
posted @ 2016-06-28 10:52 星辰之力 阅读(530) 评论(0) 推荐(0)
摘要: PullToRefreshListView中position为什么是从1开始的? 因为有个 header header 的位置是0,所以 item就从1开始了 阅读全文
posted @ 2016-06-28 09:05 星辰之力 阅读(452) 评论(0) 推荐(0)
摘要: 在PullToRefreshListView 内部内嵌了Checkbox如下图所示: 原本设计思路是:对CheckBox 进行 setOnCheckedChangeListener 监听 当CheckBox 的状态变化的时候能即时将更新积分,并将 该item的checkbox 状态存到 ListVi 阅读全文
posted @ 2016-06-28 08:59 星辰之力 阅读(243) 评论(0) 推荐(0)
摘要: android listview 使用checkbox问题 阅读全文
posted @ 2016-06-24 16:42 星辰之力 阅读(195) 评论(0) 推荐(0)
摘要: 假如ListView,分成2页(或者设置数据可以纵向拉,可隐藏),每页3条数据,每个Listview的Item 里面有个checkBox,现在,当我选择第一页的前两天数据,翻到第二页,竟然第二页后两条数据也选中了,这是绝对不允许的。经过本人的N次调试,发现public View getView(in 阅读全文
posted @ 2016-06-24 16:40 星辰之力 阅读(3830) 评论(0) 推荐(0)
摘要: 带checkbox的ListView实现(一)——数据与渲染完全分离的传统实现方式 阅读全文
posted @ 2016-06-24 16:34 星辰之力 阅读(246) 评论(0) 推荐(0)
摘要: ViewPager + Fragment实现滑动标签页 此处的wrcap_content要改成match_parent 阅读全文
posted @ 2016-06-24 15:16 星辰之力 阅读(131) 评论(0) 推荐(0)
上一页 1 ··· 152 153 154 155 156 157 158 159 160 ··· 340 下一页