maui icon indicating copy to clipboard operation
maui copied to clipboard

[regression/7.0.92] IndicatorView not visible on iOS

Open davidortinau opened this issue 2 years ago • 4 comments

Description

Screenshot 2023-10-04 at 1 22 00 PM

Works on Android, but nothing on iOS. Have tried multiple projects, and different layouts.

I confirmed this in 8.0.0 RC2 and 7.0.92.

Steps to Reproduce

Run the sample on iOS 17 or 16.4, simulator or device.

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:viewmodels="clr-namespace:CarouselViewDemos.ViewModels"
             x:Class="CarouselViewDemos.Views.HorizontalLayoutWithIndicatorsPage"
             Title="Indicators">
    <ContentPage.BindingContext>
        <viewmodels:MonkeysViewModel />
    </ContentPage.BindingContext>
    <StackLayout>
        <CarouselView ItemsSource="{Binding Monkeys}"
                      IndicatorView="indicatorView">
            <CarouselView.ItemTemplate>
                <DataTemplate>
                    <StackLayout>
                        <Frame HasShadow="True"
                               BorderColor="DarkGray"
                               CornerRadius="5"
                               Margin="20"
                               HeightRequest="300"
                               HorizontalOptions="Center"
                               VerticalOptions="Center">
                            <StackLayout>
                                <Label Text="{Binding Name}" 
                                       FontAttributes="Bold"
                                       FontSize="20"
                                       HorizontalOptions="Center"
                                       VerticalOptions="Center" />
                                <Image Source="{Binding ImageUrl}" 
                                       Aspect="AspectFill"
                                       HeightRequest="150"
                                       WidthRequest="150"
                                       HorizontalOptions="Center" />
                                <Label Text="{Binding Location}"
                                       HorizontalOptions="Center" />
                                <Label Text="{Binding Details}"
                                       FontAttributes="Italic"
                                       HorizontalOptions="Center"
                                       MaxLines="5"
                                       LineBreakMode="TailTruncation" />
                            </StackLayout>
                        </Frame>
                    </StackLayout>
                </DataTemplate>
            </CarouselView.ItemTemplate>
        </CarouselView>
        <IndicatorView x:Name="indicatorView"
                       IndicatorsShape="Square"
                       IndicatorColor="LightGray"
                       SelectedIndicatorColor="DarkGray"
                       HorizontalOptions="Center"
                       Margin="0,0,0,40" />
    </StackLayout>
</ContentPage>

Link to public reproduction project repository

https://github.com/dotnet/maui-samples/tree/main/7.0/UserInterface/Views/CarouselViewDemos

Version with bug

7.0.92

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

davidortinau avatar Oct 04 '23 18:10 davidortinau

just to add a note, there is a difference between rendering on Android and iOS but we have the indicator view working here and it seems like (at least in our project) a set height request on the CarouselView tag makes the indicator view appear.

Try setting HeightRequest="200" in your example above between lines 11 & 12

edgedj avatar Oct 05 '23 10:10 edgedj

just to add a note, there is a difference between rendering on Android and iOS but we have the indicator view working here and it seems like (at least in our project) a set height request on the CarouselView tag makes the indicator view appear.

Try setting HeightRequest="200" in your example above between lines 11 & 12

Have done a quick test with main branch with a similar result. Required to set the HeightRequest property to the CarouselView.

jsuarezruiz avatar Oct 05 '23 10:10 jsuarezruiz

Verified this on Visual Studio Enterprise 17.9.0 Preview 1(8.0.3). Repro on iOS 17.0 and MacCatalyst, not repro on Windows 11 and Android 14.0-API34 with below Project: CarouselViewDemos.zip

XamlTest avatar Dec 12 '23 08:12 XamlTest

even from the .net maui samples project of official .net maui, this issue can be reproduced

sabrigo avatar May 24 '24 04:05 sabrigo

It seems to be working fine on the latest main branch

https://github.com/user-attachments/assets/0908fd9d-cb10-455f-a149-335bd3e388b2

kubaflo avatar Sep 14 '24 00:09 kubaflo

Hi @davidortinau. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

Thanks for checking this. I added a note to try updating maui.

mattleibow avatar Sep 14 '24 08:09 mattleibow