Это простой пользовательский TextView:
public class MyTextView : AppCompatTextView
{
public MyTextView(Context context) : base(context)
{
}
public MyTextView(Context context, IAttributeSet attrs) : base(context, attrs)
{
}
public MyTextView(Context context, IAttributeSet attrs, int defStyleAttr) : base(context, attrs, defStyleAttr)
{
}
public int GetEstimatedLength()
{
int height = Height;
int lineHeight =LineHeight;
int linecount = height / lineHeight;
float textSize = TextSize;
float linewords = Width / textSize;
return (int)(linecount * (int)linewords);
}
}
, затем в вашем axml:
<MyTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lines="2"
android:textSize="31sp"
android:id="@+id/myTextView1" />
наконец в действии:
MyTextView myTextView = FindViewById<MyTextView>(Resource.Id.myTextView1);
int numbers = myTextView.GetEstimatedLength();
"числа"максимальное количество символов , не влияет на знак