Quiero escribir un párrafo como parte de mi aplicación móvil. ¿Cómo lo hago?Escribir un párrafo usando textview en Android
7
A
Respuesta
11
Use \ n para romper la línea.
Ejemplo:
TextView t = findViewById(R.id.text);
t.setText("This is the first line\nThis is the second line\nThird line...");
+0
yup se cansó, funciona. – user590849
4
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="text_with_paragraphs">
Can this contain a lot of text? Can it contain \n a newline? Yes, it can.
Adding a 2nd line like this should work.
It should not cause parsing errors.
</string>
<resources>
para que pueda hacer una referencia a él como:
android:text="@string/text_with_paragraphs"
Referencia: http://www.experts-exchange.com/Programming/Smartphones/Android/Q_27925834.html
0
Ésta ha trabajado para mí:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="text_with_paragraphs">
Can this contain a lot of text? Can it contain \n a newline? Yes, it can.
Adding a 2nd line like this should work.
It should not cause parsing errors.
</string>
<resources>
android:text="@string/text_with_paragraphs"
+0
¿Está respondiendo a la respuesta de [usuario * UnKnown *] (http://stackoverflow.com/questions/5040574/write-a-paragraph-using-textview-on-android/30107753#30107753)? –
Cuestiones relacionadas
- 1. Comience una nueva línea (párrafo) en una etiqueta o TextView
- 2. ¿Cómo hacer textView redondeado en Android?
- 3. Android TextView
- 4. Linkify en android TextView
- 5. Clickable TextView en Android
- 6. Autolink dentro de un TextView en Android
- 7. idioma diferente en TextView en Android
- 8. actualiza dinámicamente TextView en Android
- 9. Justificar texto en TextView Android
- 10. multicolor Android en una TextView
- 11. Android Simple TextView Animation
- 12. Android TextView Timer
- 13. Android TextView Wrap
- 14. Android: Linkify TextView
- 15. Explota un párrafo en oraciones en PHP
- 16. Android BitmapDrawable setTileModeX no funciona en TextView
- 17. Android TextView defStyle parámetro ignorado?
- 18. Mostrar caracteres Unicode en TextView Android
- 19. TextView android: ellipsize = "end" issue
- 20. Android Textview cursiva y wrap_contents
- 21. Cómo dibujar TextView en Canvas en android ..?
- 22. Android: texto de desplazamiento automático en TextView
- 23. dibujar la línea en TextView en Android
- 24. android textview relleno entre líneas
- 25. cómo ajustar texto en textview en android
- 26. Android: "nowrap" en Spannable en TextView
- 27. Android TextView measureText for Arabic
- 28. Android TextView enlace sin subrayado?
- 29. Copiar texto de TextView en Android
- 30. insertando textview dentro de edittext en android?
¿Qué quiere decir con un párrafo? ¿Qué características especiales desea que no se puedan cumplir con un TextView normal? tal vez usted está pensando en esto http://stackoverflow.com/questions/2979433/in-an-android-textview-is-it-possible-to-insert-paragraphs? – Adinia