我想在备用分数中写下数字。
1
_<BR>
2
而不是1/2
。为此我使用了代码
Typeface typeface = Typeface.createFromAsset(getAssets(), "Nutso2.otf");
vText.setTypeface(typeface);
vText.setText("1/2");
vText.setFontFeatureSettings("afrc");
但我收到此错误
com.example.kashif.equationsolver E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.kashif.equationsolver, PID: 4746
java.lang.NoSuchMethodError: android.widget.TextView.setFontFeatureSettings
at com.example.kashif.equationsolver.MainActivity$3.onClick(MainActivity.java:331)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)