Let's imagine I put 10 ImageView
s into a LinearLayout
. On some phones, the screen is too small, only 9 could fit. The 10th will be smaller.
Is there a way to hide the 10th if there is not not enough room on the screen?
Yes, it is possible. You can get the Height of your screen, and then add an image and calculate the height sum of all the images you added, and compare, if (sumHeightImages >= screenHeight) : then set the visibility of the rest images to GONE :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With