如何在 Android 对话框中显示版权符号?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3242251/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to show the copyright symbol in a Android dialog?
提问by user256239
I have to show copyright symbol: ? in the message of an AlertDialog. I set a string value with the copyright symbol in res/string. But the symbol is shown as a question mark when the dialog opens. How can I correctly show the copyright symbol in the dialog. Thanks.
我必须显示版权符号:?在 AlertDialog 的消息中。我在 res/string 中设置了一个带有版权符号的字符串值。但该符号在对话框打开时显示为问号。如何在对话框中正确显示版权符号。谢谢。
回答by hvdm
You can also use the Unicode character for this: "\u00A9 2010 Test"
您还可以为此使用 Unicode 字符:“\u00A9 2010 测试”
回答by Gunnar Karlsson
Use ©
to write © in a String resource:
用于©
在 String 资源中写入 ©:
Copyright © Acme Industries, Inc
Copyright © Acme Industries, Inc
becomes
变成
Copyright © Acme Industries, Inc
版权所有 © Acme Industries, Inc
回答by ajdeguzman
Write it this way:
这样写:
> String copyright = "Copyright \u00a9 2013, ajdeguzman";
回答by Sachin Suryavanshi
Use "\u00a9" it is working exactly as required.
使用 "\u00a9" 它完全按要求工作。
回答by iDea Brains
very simple, try adding \ before @
很简单,尝试在@之前添加\