How can I take a break when writing a file on Xamarin Android?

0

I've been having trouble making a line break. I call my data and in my database there is no line break. I show a little of my code. In this way I show my data.

var txtCheckpoint = FindViewById<TextView>(Resource.Id.txtCheckpoint);
txtCheckpoint.Text = modelErrorCode.CheckPoints;
    
asked by M. Bernal 30.08.2017 в 19:02
source

2 answers

0

Just add  for each line that you want to add.

In xaml:

En <label Text="Linea 1 &#10; Linea 2"...

In cs:

mivariable.Text = "linea 1" + \r\n + "linea 2";
    
answered by 01.10.2018 в 18:25
-1

If you want to insert a line break simply use:

Environment.NewLine

This you would have to concatenate value that you want at the end a line break, for example:

      string valor = "Nombre: Maria"  + Environment.NewLine + "Apellido: Bernal";
      Console.WriteLine(valor);

the output value would be:

Nombre: Maria 
Apellido: Bernal
    
answered by 30.08.2017 в 19:52