dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.24k stars 1.76k forks source link

RadioButton not visible on iOS - ContentPage #23937

Open yashaswinidc opened 3 months ago

yashaswinidc commented 3 months ago

Description

I have code that includes RadioButton elements, which works perfectly on Android. However, on iOS, the screen appears blank. When I comment out the RadioButton elements, the layout displays correctly. I have the following content on my page. Please bind some dummy data and test to reproduce the issue.

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"></RowDefinition>
        <RowDefinition Height="*"></RowDefinition>
    </Grid.RowDefinitions>
    <ScrollView>
        <StackLayout>

            <Frame HorizontalOptions="FillAndExpand"
                VerticalOptions="StartAndExpand"
                CornerRadius="8"
                Margin="20"
                BorderColor="LightGray"
                HasShadow="False">
                <Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
                    <view:ICPGoalsItem
                        ICPKey="Date"
                        ICPValue="{Binding date}"/>

                    <BoxView
                        HeightRequest="1"
                        BackgroundColor="#ebebeb"
                        Grid.Row="1"/>

                    <view:ICPGoalsItem
                        ICPKey="Subject"
                        ICPValue="{Binding ICPGoalsResposeData.Subject}"
                        Grid.Row="2"/>

                    <BoxView
                        HeightRequest="1"
                        BackgroundColor="#ebebeb"
                        Grid.Row="3"/>

                    <view:ICPGoalsItem
                        ICPKey="Sender"
                        ICPValue="{Binding ICPGoalsResposeData.Sender}"
                        Grid.Row="4"/>

                    <BoxView
                        HeightRequest="1"
                        BackgroundColor="#ebebeb"
                        Grid.Row="5"/>

                    <Button VerticalOptions="Start"
                        HeightRequest="45"
                        Grid.Row="6"
                        Margin="20,5,20,0"
                        Text="View Reports"
                        FontSize="15"
                        TextColor="White"
                        FontAttributes="Bold"
                        CornerRadius="5"
                        Command="{Binding ViewReportCommand}"
                        BackgroundColor="#2a4156"/>

                </Grid>
            </Frame>

            <StackLayout Grid.Row="1"  VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"
                         IsEnabled="{Binding IsVisibleAck}">
                <StackLayout Grid.Row="1" Margin="20,-20,20,0" Orientation="Vertical" Padding="30">
                    <StackLayout RadioButtonGroup.GroupName="{Binding GroupName}"
                                 RadioButtonGroup.SelectedValue="{Binding Selection}">
                        <Label Text="Response?" />
                        <RadioButton IsChecked="{Binding IsEndorsedChecked}" Content="Endorsed"
                                Value="862660001" />
                        <RadioButton IsChecked="{Binding IsRejectChecked}" Content="Rejected"
                                Value="862660002" />
                        <Label x:Name="response">
                        </Label>
                    </StackLayout>
                </StackLayout>

                <Frame Margin="20,-10,20,20" HasShadow="False" BorderColor="#ebebeb">
                    <StackLayout Orientation="Vertical">
                        <Label Text="Comments"></Label>
                        <Editor Text="{Binding CommetentsValue}">

                        </Editor>
                    </StackLayout>
                </Frame>

                <Button x:Name="AcknowledgementBtn"
                    VerticalOptions="Start"
                    HeightRequest="45"
                    IsEnabled="{Binding AckStatus}"
                    Grid.Row="2"
                    Margin="20,0,20,0"
                    IsVisible="{Binding IsVisibleAck}"
                    Text="Acknowledgement"
                    FontSize="15"
                    TextColor="White"
                    FontAttributes="Bold"
                    CornerRadius="5"
                    Command="{Binding AcknowledgeCommand}"
                    BackgroundColor="#2a4156" />
            </StackLayout>

            <ContentView x:Name="overlay"
                 IsVisible="{Binding IsBusy}"
                 Grid.RowSpan="2"
                 BackgroundColor="#50000000"
                 Padding="10, 0">
                <ActivityIndicator WidthRequest="110"
                         HeightRequest="70"
                         IsRunning="True"
                         IsVisible="True"
                         Color="Black"
                         HorizontalOptions="CenterAndExpand"
                         VerticalOptions="CenterAndExpand" />
            </ContentView>
        </StackLayout>
    </ScrollView>
</Grid>

Steps to Reproduce

Create a file with a RadioButton included in the ContentPage and attempt to reproduce the issue. I have already tried using minimal code, removing all other content to display only the RadioButton, but the issue still persists.

dotnet version 8.0.100

Link to public reproduction project repository

No response

Version with bug

8.0.10 SR3

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

17.5

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 3 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Zhanglirong-Winnie commented 3 months ago

This issue has been verified using Visual Studio 17.11.0 Preview 5.0(8.0.70 &8.0.10). Not repro on iOS platform. Android and iOS work fine.

yashaswinidc commented 3 months ago

Visual Studio Community 2022 for Mac: Version 17.6.13 (build 424)

Runtime .NET 7.0.3 (64-bit) Architecture: Arm64 Microsoft.macOS.Sdk 13.1.1007;

.NET Runtime (x64) Runtime: /usr/local/share/dotnet/x64/dotnet Runtime Version: 8.0.1

"Could you please verify these details? I'm finding it quite inconsistent. I'm using the latest versions in all aspects."