开发者

Get line break offset in a Spannable object

I have a Spannable object formatted like so:

This is the first line.

This is the second line. It's more fun than the first.

Why not, lets add a third line.

When I throw it in a TextView, it shows the line breaks as expected. What I want to know is, how do I get the index of the line 开发者_StackOverflowbreaks from the Spannable object? I looked at all the Spans applied and all I saw were RelativeSizeSpans and StyleSpans. Thanks.


I was treating a Spannable as if it was it's own special class, but it extends CharSequence, which means the underlying data is just normal text. I just did an indexOf(' ') and was able to find my solution.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜