-webkit-tap-highlight-color: rgba(255, 0, 0, 0);
- chcp切换cmd页码为65001
chcp 65001
Seems that the character count of the progress bar is calculated to fill in just one line, then when the next line is outputed, last line is erased so the viewer see a growing progress bar But in Chinese code pages, the characters used by the bar are full width (regular ascii characters are "half width") , which means they take up the space of 2 characters (this can be seen obviously in the first picture I posted here), and as a result the progress bar output to 2 lines, and broke itself.
| float textWidth = paintOval.measureText(progressText); | |
| Paint.FontMetricsInt fmi = paintOval.getFontMetricsInt(); | |
| float left = (width - textWidth) / 2; | |
| float top = (height - fmi.bottom - fmi.top) / 2; | |
| canvas.drawText(progressText, left, top, paintOval); |
npm全称Node Package Manager,是node.js的模块依赖管理工具。由于npm的源在国外,所以国内用户使用起来各种不方便。下面整理出了一部分国内优秀的npm镜像资源,国内用户可以选择使用。
- 搜索地址:http://npm.taobao.org/
- registry地址:http://registry.npm.taobao.org/
开发中很常见的一个问题,项目中的listview不仅仅是简单的文字,常常需要自己定义listview,自己的Adapter去继承BaseAdapter,在adapter中按照需求进行编写,问题就出现了,可能会发生点击每一个item的时候没有反应,无法获取的焦点。原因多半是由于在你自己定义的Item中存在诸如ImageButton,Button,CheckBox等子控件(也可以说是Button或者Checkable的子类控件),此时这些子控件会将焦点获取到,所以常常当点击item时变化的是子控件,item本身的点击没有响应。
这时候就可以使用descendantFocusability来解决啦,API描述如下:
android:descendantFocusability
Defines the relationship between the ViewGroup and its descendants when looking for a View to take focus.
Must be one of the following constant values.
- JAVA8(http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
- JAVA7(http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html)
- JAVA6(http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html)
- JAVA5(http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html)
- Java SE Development Kit 8 - Downloads