Can I set the width and height of ImageView in the code?

Asked 2 years ago, Updated 2 years ago, 100 views

Can I set the width and height of ImageView in the code?

android android-emulator android-widget

2022-09-22 11:51

1 Answers

image_view.getLayoutParams().height=20; You can set it like this.

The important thing is to set the height or width of and ask the layout to apply the image view change as image_view.requestLayout().


2022-09-22 11:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.