Anko: Difference between text size of anko libs and textsize xml layout

Created on 26 Jul 2017  路  4Comments  路  Source: Kotlin/anko

I have use textSize of Anko
textSize = sp(16).toFloat()
But. textSize very Big.
textSize 16sp of xml Layout is smaller textSize of Anko

Difference between text size of anko libs and textsize xml layout ??

Most helpful comment

This is because TextView's setTextSize already interprets value in scaled pixel units. Instead, you should be using just 16f. This is equivalent to 16sp in xml.

All 4 comments

This is because TextView's setTextSize already interprets value in scaled pixel units. Instead, you should be using just 16f. This is equivalent to 16sp in xml.

thanks you.

Solved my problem! Great!

thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lupajz picture lupajz  路  3Comments

nkanellopoulos picture nkanellopoulos  路  4Comments

HarryTylenol picture HarryTylenol  路  4Comments

jlandrum picture jlandrum  路  5Comments

Anilugale picture Anilugale  路  4Comments