Closed jerone closed 7 years ago
So it appeared to be some inconsistency between Xamarin.iOS and Xamarin.Android, because the following XAML code works:
<AbsoluteLayout BackgroundColor="Yellow"
HorizontalOptions="Fill"
VerticalOptions="Fill">
<StackLayout AbsoluteLayout.LayoutBounds="0,0,1,1"
AbsoluteLayout.LayoutFlags="All"
BackgroundColor="Blue"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand">
<controls:CarouselViewControl x:Name="IntroCarousel"
HorizontalOptions="FillAndExpand"
ItemTemplate="{StaticResource myTemplateSelector}"
ItemsSource="{Binding Pages}"
Position="0"
VerticalOptions="FillAndExpand" />
</StackLayout>
<StackLayout AbsoluteLayout.LayoutBounds="1,1,0.9,1"
AbsoluteLayout.LayoutFlags="All"
BackgroundColor="Red"
Orientation="Horizontal"
VerticalOptions="End">
<Button x:Name="prevBtn"
IsVisible="false"
Style="{StaticResource IntroPreviousBtnStyle}"
Text="Previous" />
<Button x:Name="nextBtn"
Style="{StaticResource IntroNextBtnStyle}"
Text="Next" />
</StackLayout>
Thanks for the great control.
Did you solved this?
@alexrainman commented on 2 dec. 2016 18:26 CET:
Did you solved this?
Yeah, see code above. The trick was to use the LayoutBounds
on both StackLayout
.
Yes, Forms has some problems in Android.
I'm not sure which one was correct (iOS or Android), but still weird that they behave differently. 😞
If my work is helping you, please help me back: https://xamarinhq.wufoo.com/forms/nominate-a-xamarin-mvp/
This is what i have done that is community visible:
We have successfully implemented the CarouselView in our application. When trying to put a few buttons for navigation on top of the CarouselView (background red), it got weird. We use
AbsoluteLayout
, because at one point we'll use a transparent background so the buttons will hover over the carousel content. However it won't render on Android, while it does work on iOS (see screenshot below).The XAML looks like:
Current situation
Screenshot of our app on iOS (working):
Screenshot of our app on Android (not working):
Expected situation
So we expected to see no yellow background and the first item of the CarouselView to be visible (purple).
Is this a bug with CarouselView?
XF 2.3.3.168 CarouselView 2.5.1