Skip to content

Commit

Permalink
优化未读数居中效果
Browse files Browse the repository at this point in the history
  • Loading branch information
hijunmeng committed Jan 6, 2017
1 parent 91c2860 commit b727b36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/src/main/java/com/hwj/demo/sb/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ private void init() {
}

private void initTab2() {
binding.sbTab2.setUnreadTextSize(10);
}

private void initTab1() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ protected void onDraw(Canvas canvas) {
unreadPaint.setTextSize(unreadTextSize);
unreadPaint.setStrokeWidth(borderWidth);
//未读数文字的宽度
canvas.drawText("" + unreadTexts[i], redCenterX - unreadTextWidth / 2.0f, redCenterY + unreadTextHeight / 2.0f - unreadTextHeight / 4.0f, unreadPaint);
canvas.drawText("" + unreadTexts[i], redCenterX - unreadTextWidth / 2.0f, redCenterY + unreadTextHeight / 2.0f - unreadTextHeight / 5.0f, unreadPaint);
}


Expand Down

0 comments on commit b727b36

Please sign in to comment.