Answers for "set android object by percentage"

0

set android object by percentage

Example:
...
TextView label=findViewById(R.id.label);
Utils.setObjectDimensions(this,label,"TextView",6.27,55,3);
...
this-> Context,
label-> your Android object,
"TextView" -> type of android object,
6.27 -> percentage of height of android device screen,
55 -> percentage of width of android device screen,
3 -> percentage of height of android device used to convert object textsize to its sp value

//
You should provide -1 to height, width and percentage for text accordingly your need of change the object dimensions,
Posted by: Guest on February-26-2021

Code answers related to "set android object by percentage"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language