我有一个换行到多行的长字符串,根据所使用的Android设备的大小,行数会有所不同。有没有办法知道文本折行到多少行?
发布于 2012-09-15 05:28:52
您可以使用以下Layout类之一:
Layout layout = new StaticLayout(text, /* other stuff--see docs */);
int nLines = layout.getLineCount();https://stackoverflow.com/questions/12432199
复制相似问题