当前位置: 编程技术>移动开发
本页文章导读:
▪四 8.OC14-Category 4 8.OC14-Category
4 8.OC14-Category
......
▪ 字体背景颜色的高度批改 字体背景颜色的高度修改
当使用android:lineSpacingExtra="5dp" 后面背景就会变大
public class BetterHighlightSpan extends ReplacementSpan {
private int backgroundColor;
public BetterHighlightSpan(int backgroundColor) {
.........
▪ Can't bind to local 8601 for debugger的解决方法 Can't bind to local 8601 for debugger的解决办法
问题原因:mac操作系统里面同时安装了eclipse 和android studio两个ide.关键是使用eclipse adb连接真机时候,android studio也处于运行状态,后者默认也是要.........
[1]四 8.OC14-Category
来源: 互联网 发布时间: 2014-02-18
4 8.OC14-Category
4 8.OC14-Category
[2] 字体背景颜色的高度批改
来源: 互联网 发布时间: 2014-02-18
字体背景颜色的高度修改
当使用android:lineSpacingExtra="5dp" 后面背景就会变大
public class BetterHighlightSpan extends ReplacementSpan {
private int backgroundColor;
public BetterHighlightSpan(int backgroundColor) {
super();
this.backgroundColor = backgroundColor;
}
@Override
public int getSize(Paint paint, CharSequence text, int start, int end, FontMetricsInt fm) {
return Math.round(paint.measureText(text, start, end));
}
@Override
public void draw(Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom,
Paint paint) {
// save current color
int oldColor = paint.getColor();
// calculate new bottom position considering the fontSpacing
float fontSpacing = paint.getFontSpacing();
float newBottom = bottom - fontSpacing;
// change color and draw background highlight
RectF rect = new RectF(x, top, x + paint.measureText(text, start, end), newBottom);
paint.setColor(backgroundColor);
canvas.drawRect(rect, paint);
// revert color and draw text
paint.setColor(oldColor);
canvas.drawText(text, start, end, x, y, paint);
}
}
TextView textView = (TextView) findViewById(R.id.textView);
SpannableStringBuilder builder = new SpannableStringBuilder("here some text and more of it");
builder.setSpan(new BetterHighlightSpan(Color.CYAN), 4, 8, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
textView.setText(builder);
[3] Can't bind to local 8601 for debugger的解决方法
来源: 互联网 发布时间: 2014-02-18
Can't bind to local 8601 for debugger的解决办法
问题原因:
mac操作系统里面同时安装了eclipse 和android studio两个ide.
关键是使用eclipse adb连接真机时候,android studio也处于运行状态,后者默认也是要连接adb
所以导致eclipse连接真机时,adb始终处于被占用状态。
解决办法:
打开实用工具,活动监视器,找到android studio进程,强制关闭。
ok,问题解决。继续查找其他问题。
问题原因:
mac操作系统里面同时安装了eclipse 和android studio两个ide.
关键是使用eclipse adb连接真机时候,android studio也处于运行状态,后者默认也是要连接adb
所以导致eclipse连接真机时,adb始终处于被占用状态。
解决办法:
打开实用工具,活动监视器,找到android studio进程,强制关闭。
ok,问题解决。继续查找其他问题。
最新技术文章: