【发布时间】:2018-01-18 13:11:15
【问题描述】:
这里是GitHub代码链接https://github.com/thanhniencung/LuckyWheel 我尝试使用这段代码更改画布的旋转
private void drawText(Canvas canvas, float tmpAngle, float sweepAngle, String mStr) {
Path path = new Path();
path.addArc(mRange,tmpAngle,sweepAngle);
float textWidth = mTextPaint.measureText(mStr);
int hOffset = (int) (mRadius * Math.PI / mLuckyItemList.size()/2-textWidth/2);
int vOffset = mRadius/2/4;
canvas.drawTextOnPath(mStr, path, hOffset, vOffset, mTextPaint);
}
【问题讨论】:
-
而你被困在......?
-
方向是固定的,我需要改变方向,你可以检查drawText方法,它写了一些字符串
-
@ArslanDurrani 我也在使用这个库。有没有可能获得点击切片?
标签: android github orientation android-canvas android-custom-view