摘要: 试试这个:TextView c1= new TextView(activity);c1.setTextColor(getResources().getColor(R.color.solid_red));c1.setText("My Text");我同意颜色和资源应该有相同的样式,但是我也花费了一些时间才找到这个解决方法。 阅读全文
posted @ 2013-08-05 13:16 mao2012 阅读(194) 评论(0) 推荐(0)
摘要: 昨天遇到这个问题,按上面各位的方法尝试过都不行。经过一番的测试,发现我是我的SDK没装全:没安装Android SDK Build-tools;解决方案:到Android sdk安装目录,打开:SDK Manager.exe,在“Tools”下的“Android SDK Build-tools”上打钩。然后点击“Install Package”,重启eclipse; 阅读全文
posted @ 2013-06-07 13:11 mao2012 阅读(186) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2013-05-16 17:31 mao2012 阅读(7) 评论(0) 推荐(0)
摘要: 工作区,暂存区,版本库,平时的开发主要在工作区,add后项目到达暂存区,commit之后项目数据才会到达版本库,此时在commit时会生出一个48为的hash值,用于唯一的标示这次提交,这个提交的具体形态起始一棵树 阅读全文
posted @ 2013-05-15 19:39 mao2012 阅读(102) 评论(0) 推荐(0)
摘要: window--preferences--General--appearance--colors and fonts--Basic-- "Text font " 然后点change,可以设置字体的大小 阅读全文
posted @ 2013-05-15 15:32 mao2012 阅读(164) 评论(0) 推荐(0)
摘要: 重新搭建开发环境时,如果选择sdk目录老是出现以前的历史位置 从而导致新的sdk位置无效 此时只要重新选择一下workpace的存储位置 就可以了file->switchWorkpace 阅读全文
posted @ 2013-05-15 13:00 mao2012 阅读(158) 评论(0) 推荐(0)
摘要: TextView textView = (TextView)findViewById(R.id.textView);TextPaint tp = textView .getPaint();tp.setFakeBoldText(true);成功 通过! 阅读全文
posted @ 2013-05-07 15:07 mao2012 阅读(1218) 评论(0) 推荐(1)
摘要: 以下是常用到的Intent的URI及其示例,包含了大部分应用中用到的共用Intent一、打开一个网页,类别是Intent.ACTION_VIEW?12Uri uri = Uri.parse("http://www.android-study.com/"); Intent intent = new Intent(Intent.ACTION_VIEW, uri);二、打开地图并定位到一个点?12Uri uri = Uri.parse("geo:52.76,-79.0342"); Intent intent = new Intent(Intent.ACTION 阅读全文
posted @ 2013-04-19 09:20 mao2012 阅读(159) 评论(0) 推荐(0)
摘要: 最近在项目中遇到新的需求,就是在按钮在选按的时候需要将文字变为白色,但android默认的按钮颜色为黑色,之前也没有考虑过类似的问题。通过doc文档,发现按钮文字的处理方式和背景的处理方式很相似,同样可以用一份selector文件来解决,然后在Button节点的textColor属性中引用这份文件,问题就迎刃而解了!<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android 阅读全文
posted @ 2013-03-26 07:47 mao2012 阅读(450) 评论(0) 推荐(1)
摘要: private class MyGuestureListener extends SimpleOnGestureListener { @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { int position = ga.getSelectedItemPosition(); if (e1.getRawX() - e2.getRawX() > 20) { if (++position == ga.getCount()) {/... 阅读全文
posted @ 2013-03-24 16:07 mao2012 阅读(801) 评论(0) 推荐(0)