Answer the question
In order to leave comments, you need to log in
How to extend ImageView via java?
It is necessary to change the parameter for the image by the checkbox:
android:layout_width="wrap_content"
to
android:layout_width="fill_content"
and back.
Answer the question
In order to leave comments, you need to log in
As far as I know, there is no parameter for width and height called fill_content.
I will think that this is a typo and you need fill_parent.
Then this line of code can solve your problem:
//сделать по ширине родителя:
imageView1.getLayoutParams().width = LayoutParams.FILL_PARENT;
//сделать по ширине контента
imageView1.getLayoutParams().width = LayoutParams.WRAP_CONTENT;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question