テキストのサイズは、次の方法でアプリに設定されます (res/values/dimens.xml):
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<dimen name="size_font">28sp</dimen>
</resources>
次に、スタイルが作成されます (res/values/styles-font.xml):
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="MyFont">
<item name="android:textStyle">normal</item>
<item name="android:textColor">@color/grey_33</item>
<item name="android:textSize">@dimen/size_font</item>
<item name="android:ellipsize">end</item>
<item name="android:lines">1</item>
</style>
</resources>
そして後でレイアウトで:
<TextView
android:id="@+id/textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/MyFont" />
問題:
システム環境設定 ([設定] --> [表示] --> [フォント サイズ]) でフォント サイズを変更しても、アプリのテキスト サイズは変更されません。
何が間違っていたのですか?解決策は何ですか?