NativeScript-Grid-View icon indicating copy to clipboard operation
NativeScript-Grid-View copied to clipboard

Aspect Ratio support

Open elMuso opened this issue 7 years ago • 1 comments

The plugin is awesome, but i encountered an obstacle when trying to create responsive ui with it.

The columns width are great and responsive, if you see 3 columns on one device you will see that in every device.

The row height tho, since it´s based on percentage (like the colwidth) , doesn´t seem very responsive, while i can see a simple square in my screen, in other screens it´s more likely i will see a rectangle. So, i suggest to add a new option called aspectratio, it will be based on the colwidth, so if you put aspectratio="1" , it will render an square in every device, and you can use this for some awesome image lists like the one netflix has, or even compare it with the flatlist of react native wich also has aspect ratio support.

I did a branch, a simple one, idk if it will work i just changed 3 lines of code and uala, now rowheight it´s the "aspect ratio" that i mentioned.

But it would be awesome that the owner of the plugin wouls do some support for this. Pretty sure that i´m not the only one that wants easy square / 16:9 rectangle list in this plugin

elMuso avatar Oct 30 '18 20:10 elMuso

Hey @Momazo7u7 , really nice idea!

Btw, the rowHeight is not only percent. You can also set it to a numerical value, for example rowHeight="300" and it will work.

PeterStaev avatar Oct 31 '18 09:10 PeterStaev