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

  • AginoEvolutionHD

    AginoEvoluti

    27 AĞUSTOS 2011
  • Lupe Fiasco

    Lupe Fiasco

    23 ŞUBAT 2006
  • New Scientist

    New Scientis

    27 Kasım 2006