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

  • Jack Vale Films

    Jack Vale Fi

    8 ŞUBAT 2007
  • Kai Moosmann

    Kai Moosmann

    5 Temmuz 2006
  • Matthew Smith

    Matthew Smit

    24 Mayıs 2010