1

I want to create an xml file from my java class. How do I set the scaleType of my xml to fitXY programmatically? (I mean from another class, not in the xml file)

It should be something like this, but everything I try doesn't seem to work.

image.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); 

1 Answer 1

1

//set like this

image.setScaleType(ScaleType.FIT_XY); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.