I am trying to add 3-4 imageviews in a scroll view. Imageviews have dynamic heights. Height of first view have 70% of the screen and second and third have 30% height. I am using constraint layout and guidelines but the height is getting set according to the height of the scroll view but not according to the screen height. Is there a way to do this with constraint layout.
Asked
Active
Viewed 201 times
1
-
have you tried it with nested scrollview ? – Taha wakeel Nov 28 '18 at 08:02
-
yes i did, but it was the same. – Sanyam koul Nov 28 '18 at 09:04
-
Paste layout code. I think you might have an issue with the height of the scroll view. – TheLibrarian Nov 29 '18 at 06:51
-
Please send your .XML file, i will you back with correction and working good.. – Prince Dholakiya Dec 01 '18 at 06:32
-
I did it programmatically. – Sanyam koul Dec 04 '18 at 07:26
1 Answers
1
Have you tried doing it programmatically?
First, get the Screenheight for your device: How to determine the screen width in terms of dp or dip at runtime in Android?
Secondly, get your Imagview and set its height according to xx% of the determined screen height.
BR

earthling
- 620
- 6
- 20