2012-09-14 90 views

回答

3

可以使用Layout的一類:

Layout layout = new StaticLayout(text, /* other stuff--see docs */); 
int nLines = layout.getLineCount(); 
+0

有沒有辦法在XML做到這一點? – Kalina

+1

@TheBeatlemaniac - 我不這麼認爲。在編譯xml時,系統無法知道它將運行的設備特徵。 –

相關問題