android - SetLayoutParams In View Cannot be Applied to int -


i'm trying set layout params view component, android studio shows me error setlayoutparams in view cannot applied int. first time i'm experiencing without problem in earlier versions of android studio. enter image description here

why , solution?

you have initialize new object 2 parameters .

use ....

tt.setlayoutparams(new viewgroup.layoutparams(     viewgroup.layoutparams.wrap_content,     viewgroup.layoutparams.wrap_content)); 

instead of this....

tv.setlayoutparams(viewgroup.layoutparams.wrap_content); 

these constructor viewgroup

o

note:-you applying int instead of view.

viewgroup.layoutparams.wrap_content int value value -2.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -