I have set frame of a ViewB using setLayoutParams(params)
from mainActivity class. When I am checking ViewB's frame in ViewB class, I am getting width, height improper. (getting width= -2, height=-1)
do any know the reason?
Thanks
I have set frame of a ViewB using setLayoutParams(params)
from mainActivity class. When I am checking ViewB's frame in ViewB class, I am getting width, height improper. (getting width= -2, height=-1)
do any know the reason?
Thanks
If your using getheight()/getwidth() functions in onCreate Methode then its too early to ask for dimensions because at that time they've not not set or in other words created.
If your fragemnt's height is wrap_contnent or match_parent in your xml then you still wont get the height, width correct because the dimensions are already set in xml and its not a fixed numerical value. I think -1 is for match_parent.