2016-03-29 23 views
1

Metin elde edebiliyorum ancak tüm etiketler düzgün çalışmıyor. Kalın ve italik etiket, break etiketinin çalıştığı yerde çalışmıyor.Biçimlendirilmiş html metnini String.xml'den bir metin görünümünde nasıl ayarlanır?

Benim String.xml geçerli:

<resources> 
<string name="app_name">MyAppTXT_PageSplit</string> 
<string name="text_to_show" formatted="false"> 
    <![CDATA[ 
     <i><b>Forbes Leadership, 2015</b></i><br><br> 
     Your Emotional Intelligence (EI) directly relates to your ability to lead people successfully. One of many studies correlating Executives’ EI scores with their company’s profitability demonstrated that those with higher EI capabilities were more likely to be highly profitable (Leadership & OD Journal ,2009) 

     <br><br>LeaderShaper is a self-development tool for professionals to develop their Emotional Intelligence as a key step to becoming a better leader and enabling high performance. Focus on one set of competencies at a time and get some real practical advice on how to improve your EI through behavioural change. You can repeat it to see how your scores improve. 
     <br><br>Just enter your own ratings against each of the questions. When you complete a section, click on the ADVICE button for practical advice to help you improve your EI. 
     <br><br>Once you have completed the questionnaire, you can obtain a LeaderShaper Pro Report for £2.99, showing how your EI profile rates against each of the six recognised leadership styles. 
     <br><br> 
     <b>&#8226;</b> &#160;&#160;&#160;&#160; Visionary, Coaching, Democratic, Affiliative, Pacesetting &amp; Commanding <br> 
    ]]> 
</string> 

Ve TextView'un metnini ayarlamak için My kodudur:

txt_show.setText(Html.fromHtml(getResources().getString(R.string.text_to_show))); 
+0

.. linke http://stackoverflow.com/questions/1529068/is-it-possible-to-have-multiple-styles-inside-a-textview –

cevap

0

<string name="text_to_show" formatted="false"> 

den formatted="false" kaldırma veya ayarlayın 0'a.

+0

çalıştığını Thanx sonrasında bu takdirde –

+0

@PratimSahoo tercih edin yardım etti, lütfen cevabı kabul edin. –

+0

@PratimSahoo teşekkürler :) –

0

Kodunuzu kontrol ettim ve uygulamamı denedim, ancak iyi çalışıyor. , bazı android sürüm sorunu veya cihaz sorunu olabilir. enter image description here

+0

nexus 5 cihazını kullanıyorum. –

+0

Thanx çalışıyor .. –

+0

Bu metni TextView uygulamasında görüntülediğimde iyi çalışıyor ... ama dizeyi sayfalara böldüğümde kalın ve italik etiket çalışmıyor. –

İlgili konular