我想在 Android Studio 中写波斯语,但是在输入波斯语后,Android Studio 显示了一些奇怪的字符。当然,大约 3 个月是对的,但突然之间就很奇怪了。
5 回答
在 android studio 1.2 你应该去配置>设置>颜色和字体>字体>使用你的方案>取消选中仅显示等宽字体>最后使用 tahoma 字体并应用并确定。好好享受!
在 Android Studio 中,转到设置--> 编辑器--> 字体和颜色--> 字体,选中“辅助字体”复选框并从列表中定义一个波斯语字体,如“Nazanin”。另外,取消选中“仅显示等宽字体”。
In android versions later than 3, you don't need anything but in earlier versions you must add Farsi.java to your app and in the code write text as follow:
MyTextView = (TextView) findViewById(R.id.MyTextView);
Typeface tf = Farsi.GetFarsiFont(this);
MyTextView.setTypeface(tf);
MyTextView.setText(Farsi.Convert("سلام"));
you cann't write farsi text in xml files in earlier versions!!! so I suggest to use newer versions of android.
select your project in android studio and go to File/Setting menu
. in the opened page point to File Encodings
option and in that tabbed ensure IDE Encoding
is UTF-8
对于 Windows 中的 Android Studio 1.5,在C:\Users\.AndroidStudio1.5中创建名为“idea.properties”
的文件并将其写入文件中:
editor.new.rendering=true