It may be too late but for the sake of others who have the same problem, to set the height of the ImageView
:
imageView.getLayoutParams().height = 20;
Important. If you’re setting the height after the layout has already been ‘laid out’, make sure you also call:
imageView.requestLayout();
More Related Contents:
- How do I detect the heap size usage of an android application
- Clickable widgets in android
- What is sharedUserId in Android, and how is it used?
- Android Studio error: “Manifest merger failed: Apps targeting Android 12” [duplicate]
- Android – Get value from HashMap
- How to fix INSTALL_PARSE_FAILED_MANIFEST_MALFORMED in my android application
- SearchView.OnCloseListener does not get invoked
- How to speed up unzipping time in Java / Android?
- Android – Read Only File System IOException
- Using accelerometer, gyroscope and compass to calculate device’s movement in 3D world
- How to display a two column ListView in Android?
- Android Spinner – How to make dropdown view transparent?
- I'm new to coding, and I have a idea but don't know how to code it [closed]
- How to pass int value from one activity to another and display in TextView? [duplicate]
- How to save the current date/time when I add new value to Firebase Realtime Database
- Android: Internet connectivity change listener
- Android Studio Google JAR file causing GC overhead limit exceeded error
- Running Shell commands though java code on Android?
- Unable to create Android Virtual Device
- How to pass a URI to an intent?
- Is there any library or algorithm for Persian (Shamsi or Jalali) calendar in Android? [closed]
- Didn’t find class “androidx.core.app.CoreComponentFactory”
- Convert normal Java Array or ArrayList to Json Array in android
- Should I strictly avoid using enums on Android?
- Android 3.1 USB-Host – BroadcastReceiver does not receive USB_DEVICE_ATTACHED
- No resource identifier found for attribute ‘layout_behavior’ in package
- How to exit an Android app programmatically?
- Android app crashes after SDK-tools update version (NoClassDefFound, tool version 22)
- Android Retrofit Parameterized @Headers
- How to add rectangles on top of existing rectangle in canvas