Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

CarouselView sizing issue on iOS only #31

Open
glenr4 opened this issue Aug 8, 2017 · 1 comment
Open

CarouselView sizing issue on iOS only #31

glenr4 opened this issue Aug 8, 2017 · 1 comment

Comments

@glenr4
Copy link

glenr4 commented Aug 8, 2017

On Android CarouselView works fine for me, it sizes itself correctly and so I can see my buttons below it. However on iOS I get this:
https://drive.google.com/open?id=0B_xcMUIAqWMSSXpvY0pwTFdtUEk

I added a red background to the CarouselView for debugging purposes. As you can see there is a huge amount of unnecessary above the picture.

My Code (MainTemplate is a ContentPage which is inside a TabbedPage):

<?xml version="1.0" encoding="utf-8" ?>
<local:MainTemplate xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:r="clr-namespace:OTL.Renderers"
             xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms" 
             xmlns:cv="clr-namespace:CarouselView.FormsPlugin.Abstractions;assembly=CarouselView.FormsPlugin.Abstractions"
             xmlns:local="clr-namespace:OTL.Views"
             x:Class="OTL.Views.MyStuff">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <local:TopBanner Grid.Row="0"/>

        <!--Main Content-->
        <StackLayout Orientation="Vertical" Grid.Row="1" Margin="20, 0, 20, 0">
            <StackLayout Orientation="Horizontal" Margin="0, 30, 0, 0">
                <Label Text="My Stuff" 
                       HorizontalOptions="Start" 
                       Style="{StaticResource LargeHeading}"/>

                <Label Text="" HorizontalOptions="FillAndExpand"/>

                <r:HighlightButton Image="add.png"  
                                       HorizontalOptions="End"
                                       Command="{Binding AddPhotoCommand}" 
                                       Style="{DynamicResource ImageButton}" />

                <Button x:Name="forceLayout" Text="Force layout" />
            </StackLayout>

            

            <StackLayout x:Name="carouselWrapper" Orientation="Vertical">
                
                <cv:CarouselViewControl HorizontalOptions="Center" VerticalOptions="Start"
                                          AnimateTransition="true"
                                        InterPageSpacing="2"
                                          IsSwipingEnabled="true"
                                        Orientation="Horizontal" 
                                        Position="{Binding CurrentImageIndex}"
                                        ItemsSource="{Binding MyStuffFiles}" 
                                         BackgroundColor="Red">
                
                    <cv:CarouselViewControl.ItemTemplate>
                        <DataTemplate>
                            <ffimageloading:CachedImage HorizontalOptions="Center"
                                            VerticalOptions="Center"
                                            Aspect="AspectFit"
                                            Source="{Binding .}"
                                            DownsampleToViewSize="True"
                                            LoadingPlaceholder="logo_wh_large.png"/>
                            
                        </DataTemplate>
                    </cv:CarouselViewControl.ItemTemplate>
                </cv:CarouselViewControl>

                
                <!--Delete Button-->
                <r:HighlightButton Image="delete_rd.png" 
                                       
                                       Style="{DynamicResource ImageButton}" 
                                       Command="{Binding DeleteCommand}" 
                                       HorizontalOptions="End" />
                <!--IsVisible="{Binding ArrowsVisible}"-->

                <!-- Arrow buttons -->
                <StackLayout Orientation="Horizontal" HorizontalOptions="Center">
                    <!--Previous Button-->
                    <r:HighlightButton Image="prev.png" 
                                       
                                       Style="{DynamicResource ImageButton}" 
                                       Command="{Binding PrevCommand}" 
                                       HorizontalOptions="Start"
                                       VerticalOptions="Start"/>
                    <!--IsVisible="{Binding ArrowsVisible}"-->

                    <!--Navigation Text-->
                    <Label Text="{Binding NavText}"
                           Style="{StaticResource SubHeading}"
                           
                           VerticalOptions="Center" />
                    <!--IsVisible="{Binding ArrowsVisible}"-->

                    <!--Next Button-->
                    <r:HighlightButton Image="next.png" 
                                       
                                       Style="{DynamicResource ImageButton}" 
                                       Command="{Binding NextCommand}" 
                                       HorizontalOptions="End" 
                                       VerticalOptions="Start"/>
                    <!--IsVisible="{Binding ArrowsVisible}"-->
                </StackLayout>
            </StackLayout>
        </StackLayout>
    </Grid>
</local:MainTemplate>
@skadookkunnan
Copy link

Looks like this issue is back with the Xamarin Forms 5 SDK's Carousel View.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants