我正在使用以下代码
LayoutInflater inflater = (LayoutInflater) getActivity()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View innerView = inflater.inflate(R.layout.ac_image_list, null);
TextView tv = (TextView) innerView.findViewById(R.id.tv_sorting);
tv.setText(Html.fromHtml(getString(R.string.sort_by_num_messages)));
字符串 sort_by_num_messages 定义为
<string name="sort_by_likes"><![CDATA[Sort by <b>Messages</b>]]></string>
问题是显示如下:Sort by <b>Messages</b>
该代码正在其他活动中工作,我没有使用 LayoutInflator。该代码在用作 Tab 的 SherlockFragment 中使用。