Maui icon indicating copy to clipboard operation
Maui copied to clipboard

[BUG] The VerticalOptions of Refresh or other Layout is unavaiable in the StateContainer.StateViews on Android platform

Open rwecho opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

  • [X] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

Current Behavior

             <VerticalStackLayout mct:StateContainer.CurrentState="{Binding RefreshState}"
                                 HeightRequest="100"
                                BackgroundColor="red">
                   <mct:StateContainer.StateViews>
                       <RefreshView mct:StateView.StateKey="Success" VerticalOptions="FillAndExpand">
                           <ScrollView>
                                <Label Text="hello world"></Label>
                           </ScrollView>
                       </RefreshView>
                </mct:StateContainer.StateViews>
            </VerticalStackLayout>

Like the above code, the RefreshView should be visible if the data loaded success. It's ok on the Windows Machine. But when I debug it on Android emulators and Android phones, the RefreshView is invisible.

Expected Behavior

The layout in the StateViews display.

Steps To Reproduce

  1. open the sample and change the label with a RefreshView .
  2. set the target with an Android emulator.
  3. By default the component is not displayed until we set a HeightRequest.

Link to public reproduction project repository

https://github.com/rwecho/Maui/blob/c23990f3df8565658670bb7fc2d4a72bde016bb9/samples/CommunityToolkit.Maui.Sample/Pages/Layouts/StateContainerPage.xaml#L204-L229

In the StateContainerPage.xaml page , I add a demo in the bottom of the page.

Environment

- .NET MAUI CommunityToolkit:5.2.0
- OS: Android 11
- .NET MAUI:8.0.0-preview.5.23280.8

rwecho avatar Jul 13 '23 09:07 rwecho