Width between two lines in EditText?
Is it possible to calculate width between two lines in a EditText ?
If so how can I do that ? I need to calculate the number of lines that an EditText can take with the given height of it ! I can get the text width and I need to get the line width too .. but I dont know how to find that ..
Can anyone help me regarding this !!
Thanks,
开发者_StackOverflow中文版Siva Kumar
Did you try this? :
public int getLineBounds (int line, Rect bounds) Since: API Level 1
Return the baseline for the specified line (0...getLineCount() - 1) If bounds is not null, return the top, left, right, bottom extents of the specified line in it. If the internal Layout has not been built, return 0 and set bounds to (0, 0, 0, 0)
Parameters
line which line to examine (0..getLineCount() - 1)
bounds Optional. If not null, it returns the extent of the line
Returns
the Y-coordinate of the baseline
Link to the API
精彩评论