Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
これが私がそれを実装する方法です
topBar.setTextSize(TypedValue.COMPLEX_UNIT_DIP, R.dimen.sTextSize);
これが寸法です
<item name="sTextSize" format="float" type="dimen">30.0</item>
テキストサイズが非常に非常に小さいことがわかりました。何が起こっているのですか?
そのIDの下に保存されている値ではなく、IDをテキストサイズとして設定しています。代わりに、次のようなことを行う必要があります。
int textSize = getResources().getDimension(R.dimen.sTextSize); topBar.setTextSize(TypedValue.COMPLEX_UNIT_DIP, textSize);