//Obtener el ancho del texto var spec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); tv_textcontent.measure(spec, spec); var textPaint = tv_textcontent.getPaint(); var textPaintWidth = textPaint.measureText (cadena);
var textwidth=px2dp(mContext, tv_textcontent.width.toFloat())//ancho de control de texto var mwidth=px2dp(mContext, textPaintWidth)//ancho requerido del texto de cadena
// Cuando el ancho del texto es mayor que el ancho m, se puede mostrar una línea; de lo contrario, se requiere un salto de línea.