From b727b36c66eb7adeb52cf5c0db4d025a52fe31b3 Mon Sep 17 00:00:00 2001 From: huweijian5 <304797017@qq.com> Date: Fri, 6 Jan 2017 18:53:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9C=AA=E8=AF=BB=E6=95=B0?= =?UTF-8?q?=E5=B1=85=E4=B8=AD=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/hwj/demo/sb/MainActivity.java | 1 + lib_segmentbar/src/main/java/com/hwj/junmeng/sb/SegmentBar.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/hwj/demo/sb/MainActivity.java b/app/src/main/java/com/hwj/demo/sb/MainActivity.java index 3ee89e5..c1a1365 100644 --- a/app/src/main/java/com/hwj/demo/sb/MainActivity.java +++ b/app/src/main/java/com/hwj/demo/sb/MainActivity.java @@ -28,6 +28,7 @@ private void init() { } private void initTab2() { + binding.sbTab2.setUnreadTextSize(10); } private void initTab1() { diff --git a/lib_segmentbar/src/main/java/com/hwj/junmeng/sb/SegmentBar.java b/lib_segmentbar/src/main/java/com/hwj/junmeng/sb/SegmentBar.java index f0e8563..350b429 100644 --- a/lib_segmentbar/src/main/java/com/hwj/junmeng/sb/SegmentBar.java +++ b/lib_segmentbar/src/main/java/com/hwj/junmeng/sb/SegmentBar.java @@ -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); }