Android XML escape “@” Symbol

后端 未结 2 358
清歌不尽
清歌不尽 2021-01-11 15:29

How do you use the @ as text in an Android XML file, as it has special meaning? I have a TextView which will simply hold the text @

相关标签:
2条回答
  • 2021-01-11 15:54
    android:text="\@"
                  ^
    

    instead of

    android:text="@"
    
    0 讨论(0)
  • 2021-01-11 16:02

    use this way ..............

     <string name="at">\@</string>
    
    0 讨论(0)
提交回复
热议问题