alexrainman / CarouselView

CarouselView control for Xamarin Forms
MIT License
436 stars 178 forks source link

iOS: Rendering issue #565

Open davidtabor90 opened 4 years ago

davidtabor90 commented 4 years ago

Hi,

I'm trying to use carousel with scrollview and I found that I can't scroll to the end. Than i try coloring element and it looks like elements rendering is not well.

I'm using XF 4.4 and CarouselView.FormsPlugin 5.2

Here is easy sample view code

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             x:Class="MyApp.Views.TestPage"
             xmlns:carousel="clr-namespace:CarouselView.FormsPlugin.Abstractions;assembly=CarouselView.FormsPlugin.Abstractions">
    <ContentPage.Content>
        <StackLayout BackgroundColor="Yellow"
            Margin="20">
            <carousel:CarouselViewControl
                x:Name="carouselControl"
                BackgroundColor="Accent"
                Margin="20"
                VerticalOptions="FillAndExpand"
                HorizontalOptions="FillAndExpand">
                <carousel:CarouselViewControl.ItemsSource>
                    <x:Array Type="{x:Type BoxView}">
                        <BoxView 
                            BackgroundColor="Red"   
                            Margin="20" 
                            VerticalOptions="FillAndExpand"
                            HorizontalOptions="FillAndExpand"/>
                        <BoxView 
                            BackgroundColor="Gray" 
                            Margin="20"
                            VerticalOptions="FillAndExpand"
                            HorizontalOptions="FillAndExpand"/>
                    </x:Array>
                </carousel:CarouselViewControl.ItemsSource>
            </carousel:CarouselViewControl>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>

Here is result on iPhone image

Here is result after add some space in code when debugging and HotReload refresh page image

alexrainman commented 4 years ago

Why you need to use it inside a ScrollView?

SagarPanwala commented 4 years ago

I have same problem with following hierarchy

ScrollView
 - Stack
      - Header Card
      - Horizontal Stack to mimic 2 tabs
      - CarouselView

I have to enable vertical scrolling data for both tabs. So Header Card, Tabs and Carousel Content it self can move upword