读书人

android xml中施用占位符

发布时间: 2012-09-23 10:28:11 作者: rapoo

android xml中应用占位符
Formatting and Styling

Here are a few important things you should know about how to properlyformat and style your string resources.

Escaping apostrophes and quotes

If you have an apostrophe or a quote in your string, you must either escape it or enclose thewhole string in the other type of enclosing quotes. For example, here are some stings thatdo and don't work:

fromHtml(String), the characters come out the way they wereoriginally written. For example:

String escapedUsername = TextUtil.htmlEncode(username);Resources res = getResources();String text = String.format(res.getString(R.string.welcome_messages), escapedUsername, mailCount);CharSequence styledText = Html.fromHtml(text);

读书人网 >XML SOAP

热点推荐