¿Cómo ver la cadena completa en NSTextFieldCell?

When I put a long string inside my NSTableView the text isn't displayed wholly:

The string is too long

I need to allow user to see the whole string (maybe with scroll or tooltip, it doesn't matter). Any suggestions?

Muchas Gracias

preguntado el 30 de enero de 12 a las 19:01

1 Respuestas

If it is ok to have a multiline text view, this would be the easiest solution. But from your example I guess the answer is no.

You could embed the NSTextField in a scroll view. If the text is longer than the allowed width, you could simply show the scroll handles. If not, they would not be shown and the user doesn't even see that it's a scroll view.

For both of the above examples, it will be helpful to know how long the text actually is and if the textfield is long enough to display the whole text.

Tu puedes hacer [textField sizeToFit] y [textField frame].size.width verificar.

Respondido 13 Feb 12, 03:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.