首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > XML SOAP >

android xml中施用占位符

2012-09-23 
android xml中应用占位符Formatting and StylingHere are a few important things you should know about

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);

热点排行