Cardview: Sizing carousel view to full width without weird margins

Created on 2 Jul 2018  路  5Comments  路  Source: AndreiMisiukevich/CardView

For example
In Iphone emulator 2436x1125 i need to specify a height of ~250px
In Android device 782x480 i need to specify a height of ~215px

Something weird in iphone emulator for example, with 1125px width, for the image to fully cover horizontally no way the carousel should have less than ~500px height while testing it needs ~250px height.

question resolved wontfix

Most helpful comment

Worked ty.
I placed this code in the Image inside the DataTemplate.

img.WidthRequest = DeviceDisplay.ScreenMetrics.Width;
img.Aspect = Aspect.AspectFill;

All 5 comments

Did you try to change aspect of image?
Aspect.Fill etc

https://docs.microsoft.com/en-us/dotnet/api/xamarin.forms.aspect?view=xamarin-forms

I hope, it will help you.
Point is that isn't CardsView issue.. this is something with image settings

Contact me pls after trying this way

Worked ty.
I placed this code in the Image inside the DataTemplate.

img.WidthRequest = DeviceDisplay.ScreenMetrics.Width;
img.Aspect = Aspect.AspectFill;

Super! =)
If you like this plugin, star please this project )

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shoeIT picture shoeIT  路  6Comments

EldinHb picture EldinHb  路  8Comments

InquisitorJax picture InquisitorJax  路  6Comments

LuisM000 picture LuisM000  路  3Comments

baranpirincal picture baranpirincal  路  4Comments