0

good day,

I was wondering, probably i do something wrong but i don't get it.

i defined

<dimen name="title">16sp</dimen>

When i set it in xml with something like

<TextView android:textSize="@dimen/title"/>

i get a different size (smaller) then when i set it in code.

int mTitleSize = res.getDimension(R.dimen.title);
textView.setTextSize(mTitleSize );

I also tried

tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, mTitleSize);

But that results in the same text size (still biger then the textview in xml.

Does anyone has the same experience/encoutered the same probleem and have a solution (or just a solution)?

Thanks

4

0 回答 0