1
次のコードを使用して、フォントサイズを中、高、または小に変更しています。テキスト表示の設定中にそのようなメソッドエラーが発生しない
java.lang.NoSuchMethodError: No virtual method setTextAppearance(I)V in class Landroid/widget/TextView; or its super classes (declaration of 'android.widget.TextView' appears in /system/framework/framework.jar)
がなぜこのようなエラーを取得しています:getFontSize()
は、次のエラーを取得し、これらのサイズ
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
holder.title.setTextAppearance(new AppController().getFontSize());
else
holder.title.setTextAppearance(mContext, new AppController().getFontSize());
しかし、イムのいずれかを返しますか?
ここで問題をご覧くださいhttps://code.google.com/p/android/issues/detail?id=183542 – rafsanahmad007
コンパイラが失敗するはずですが、実際にはクラッシュしないようです。 @ rafsanahmad007リンクによると、@ depfsatedメソッドに関連していると思います。 –
'新しいAppController()。getFontSize()'は '@StyleRes int'(スタイルリソースを表す' int')を返しますか? –