我想在左抽屉布局中使用西里尔字母.它应该像菜单一样工作.
我试图将字符串格式化为西里尔文语言环境,但是它不起作用,而是被替换为???.
private String[] drawerTitles;
drawerTitles[0] = String.format(new Locale("bs_#Cyrl"),"1 фыв");
为什么会这样,并且必须更改西里尔字母?
感谢您的帮助
解决方法:
尝试在res / values / strings.xml中定义字符串
<!-- Nav Drawer Menu Items -->
<string-array name="nav_drawer_items">
<item >1 фыв</item>
<item >2 фыв</item>
<item >3 фыв</item>
<item >4 фыв</item>
</string-array>
和
....
navDrawerItems = new ArrayList<NavDrawerItem>();
navDrawerItems.add(new NavDrawerItem(navMenuTitles[0], navMenuIcons.getResourceId(0, -1)));
navDrawerItems.add(new NavDrawerItem(navMenuTitles[1], navMenuIcons.getResourceId(1, -1)));
navDrawerItems.add(new NavDrawerItem(navMenuTitles[2], navMenuIcons.getResourceId(2, -1)));
navDrawerItems.add(new NavDrawerItem(navMenuTitles[3], navMenuIcons.getResourceId(3, -1)));
navMenuIcons.recycle();
adapter = new NavDrawerListAdapter(getApplicationContext(),
navDrawerItems);
....