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.
デフォルトのフォント サイズに対するパーセンテージでフォント サイズを設定したいので、TextView のデフォルトのフォント サイズを取得する必要があります。
TextView のデフォルトのフォントサイズを取得するにはどうすればよいですか?
これは、コンテキスト内のピクセル単位で値を返します。
float size = new TextView(this).getTextSize();
TextView txt = (TextView) findById(R.id.text); float size = txt.getTextSize();
これは、既存のものでそれを行う必要があります