SORU
21 Mart 2011, PAZARTESİ


Nasıl bir Android TextView içinde bir satır sonu eklemek için?

Bu TextView içinde bir satır sonu eklemek için çalışıyorum.

\N önerdi denedim ama hiçbir şey yapmaz. Mesajlarıma kurdum.

TextView txtSubTitle = (TextView)findViewById(r.id.txtSubTitle);
txtSubTitle.setText(Html.fromHtml(getResources().getString(R.string.sample_string)));

Bu benim dizisi: <string name="sample_string">some test line 1 \n some test line 2</string>

Öyle gibi göstermelidir:

some test line 1
some test line 2

Ama gösterir: some test line 1 some test line 2.

Bir şey mi kaçırdım?

CEVAP
19 AĞUSTOS 2011, Cuma


\r\n benim için çalışıyor <TextView android:text="First line\r\nNext line"

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • jat4011

    jat4011

    16 EKİM 2010
  • NightShader1

    NightShader1

    25 Temmuz 2006
  • xCraash

    xCraash

    6 Temmuz 2012