Android studio format code won't auto break li

2020-02-26 02:51发布

tempCanvas.drawArc(cx - mInnerCircleRadius, cy + mInnerCircleRadius,cy + mInnerCircleRadius,cy + mInnerCircleRadius);

For example, the above code is too long, so I want to break the line at every ,. Eclipse will do it but Android Studio won't break the line when I hit format code. Is there any method to do it?

7条回答
Melony?
2楼-- · 2020-02-26 03:54

As a reminder to others visiting this question, you can also manually add line breaks by hitting enter after the commas or other appropriate places in the code. Android Studio will automatically indent it. This makes long lines more readable.

tempCanvas.drawArc(
        cx - mInnerCircleRadius, // You can also add comments 
        cy + mInnerCircleRadius, // to different parts of a line
        cy + mInnerCircleRadius, // this way.
        cy + mInnerCircleRadius);
查看更多
登录 后发表回答