摘要: 继承父状态,然后使用Selector如果是用Linearlayout里面动态添加Linearlayout的情况,就要代码控制了// 就是为了改变颜色。 ly.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { foodName.setTextColor(getResources().getColor(R.color.color_text 阅读全文
posted @ 2013-10-23 09:50 leestar54 阅读(417) 评论(0) 推荐(0)
摘要: 将按钮的android:focusable="false" 阅读全文
posted @ 2013-10-23 09:47 leestar54 阅读(329) 评论(0) 推荐(0)
摘要: // 定时更换广告。5秒一次 timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { // 判断是否在滑动ING if (!isPagerScrolling) { Message message = Message.obtain(); ad_index = mPager.getCurrentItem(); if (ad_index < ad_count) { ad_index++; } else { ad_index = 0; } message.arg1 阅读全文
posted @ 2013-10-23 09:46 leestar54 阅读(191) 评论(0) 推荐(0)
摘要: editView里面添加android:digits="1234567890.+-*/%\n()",android:numeric="integer" 阅读全文
posted @ 2013-10-23 09:46 leestar54 阅读(141) 评论(0) 推荐(0)
摘要: 在Android开发中通过localhost或127.0.0.1访问本地服务器时,会报java.net.ConnectException: localhost/127.0.0.1:8083 -Connection refused异常。为什么会报这个异常呢?因为Android模拟器本身把自己当做了localhost或127.0.0.1,而此时我们又通过localhost或127.0.0.1访问本地服务器,所以会抛出异常了。在网上查了下,在模拟器上可以用10.0.2.2代替127.0.0.1和localhost; 阅读全文
posted @ 2013-10-23 09:44 leestar54 阅读(287) 评论(0) 推荐(0)