get Desired Text Width - Android android.text

Android examples for android.text:TextPaint

Description

get Desired Text Width

Demo Code

import android.text.Layout;
import android.text.TextPaint;

public class Main {

  public static float getDesiredWidth(String str, TextPaint paint) {
    float strWidth = Layout.getDesiredWidth(str, paint);
    return strWidth;
  }/*ww  w  . j a  v a2s . com*/

}

Related Tutorials