1

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.

Sanyam koul
  • 87
  • 10

1 Answers1

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