How to have “&” i.e and symbol in Android TextView

后端 未结 8 469
半阙折子戏
半阙折子戏 2020-12-24 11:51

I want to have some simple text in textView..

Like...(android & java)

means I exactly require \"and\" symbol in textView

If I\'m pro

相关标签:
8条回答
  • 2020-12-24 12:35

    Use this :

       &lt; for < 
       &gt; for > 
       &amp; for &
    

    Example:

      <string name="lessthan"> &lt; teste &gt;</string>
      <string name="link"> Puzzles &amp; code </string>
    
    0 讨论(0)
  • 2020-12-24 12:38

    The layout files are just xml and the & symbol is not allowed by itself.

    You will need to use & instead of &

    This will work fine

      <string name="contest_giveaways" formatted="false">Contests &amp; Giveaways</string>
    
    0 讨论(0)
提交回复
热议问题