用代码示例回答:
CharSequence allText = ""; for (String aBulletpoint : bulletpoint) { String text = aBulletpoint.trim() + "."; SpannableString spannableString = new SpannableString(text + "\n"); spannableString.setSpan(new LeadingMarginSpan() { @Override public int getLeadingMargin(boolean first) { return getString(R.string.bulletpoint).length() * 50; } @Override public void drawLeadingMargin(Canvas c, Paint p, int x, int dir, int top, int baseline, int bottom, CharSequence text, int start, int end, boolean first, Layout layout) { if (first) { Paint.Style orgStyle = p.getStyle(); p.setStyle(Paint.Style.FILL); c.drawText(getString(R.string.bulletpoint) + " ", 0, bottom - p.descent(), p); p.setStyle(orgStyle); } } }, 0, text.length(), 0); allText = TextUtils.concat(allText, spannableString); } someTextView.setText(allText);