Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradient not appearing on iOS #8402

Closed
Javierflo95 opened this issue Jun 29, 2022 · 16 comments · Fixed by #7925
Closed

Gradient not appearing on iOS #8402

Javierflo95 opened this issue Jun 29, 2022 · 16 comments · Fixed by #7925
Assignees
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing fixed-in-7.0.58 Look for this fix in 7.0.58! fixed-in-7.0.100 fixed-in-7.0.101 fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! platform/iOS 🍎 t/bug Something isn't working

Comments

@Javierflo95
Copy link

Description

I implemented my own design on XAML using Android, with normal background and LinearGradientBrush, and when I tested on iOS I get this visual inconsistency
image

Steps to Reproduce

  1. Create NET MAUI App
  2. Replace MainPage to this XAML

<Grid RowDefinitions="Auto,3*,*,*">
    <Grid Margin="{OnPlatform Android='-20,-20,0,0', iOS='-40,-20,0,0'}">
        <Image Source="deporte" HeightRequest="{OnPlatform Android='600', iOS='600'}"/>
    </Grid>
    <Grid Grid.Row="1" HorizontalOptions="FillAndExpand" BackgroundColor="Transparent"
          Margin="{OnPlatform Android='0,-180,0,-100', iOS='0,-80,0,-1'}">
        <Frame BorderColor="transparent">
            <Frame.Background>
                <LinearGradientBrush StartPoint="1,0" EndPoint="1,1">
                    <GradientStop Offset=".5" Color="Transparent"/>
                    <GradientStop Offset=".1" Color="{StaticResource GenOrange}"/>
                    <GradientStop Offset=".1" Color="{StaticResource GenOrange}"/>
                    <GradientStop Offset=".1" Color="{StaticResource GenOrange}"/>
                    <GradientStop Offset=".1" Color="{StaticResource GenOrange}"/>
                    <GradientStop Offset=".1" Color="{StaticResource GenOrange}"/>
                </LinearGradientBrush>
            </Frame.Background>
        </Frame>
        <Grid HeightRequest="210" WidthRequest="210" HorizontalOptions="Center">
            <Image x:Name="logo_gen" Source="logo_generations_bluedark" HeightRequest="200"  
                   WidthRequest="200" HorizontalOptions="Center" VerticalOptions="Center"
                   Margin="0,-180,0,0"/>
        </Grid>
    </Grid>
    <StackLayout Grid.Row="3" Margin="0,-200,0,10" VerticalOptions="CenterAndExpand"
                 HorizontalOptions="FillAndExpand" Spacing="10">
        <Label Text="Lorem Ipsum dolor" TextColor="White" HorizontalOptions="CenterAndExpand" />
        <Label Text="consectetuer adlplsicing ellit." TextColor="White" HorizontalOptions="CenterAndExpand" />
        <Border StrokeThickness="2" StrokeShape="Rectangle" Margin="30,0,30,0" BackgroundColor="{StaticResource GenDark}" >
            <Button Text="SIGN UP NOW" TextColor="White" BorderWidth="0" HorizontalOptions="FillAndExpand" 
                    BackgroundColor="Transparent" BorderColor="Transparent" Command="{Binding GoToRegisterPage}"/>
        </Border>
    </StackLayout>
    <StackLayout Grid.Row="4" VerticalOptions="FillAndExpand">
        <FlexLayout Direction="Column">
            <BoxView HorizontalOptions="FillAndExpand" HeightRequest=".1" Color="White"/>
        </FlexLayout>
        <Button Text="LOGIN" TextColor="White" BackgroundColor="Transparent" BorderColor="Transparent" 
                BorderWidth="0" Command="{Binding GoToLoginPage}"/>
    </StackLayout>
</Grid>
3. Run App

Version with bug

6.0.400 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

Android 12, iOS 15

Did you find any workaround?

No response

Relevant log output

No response

@Javierflo95 Javierflo95 added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Jun 29, 2022
@Ahmadmansoor
Copy link

This is normal, I think u have to make a check for the system ( Andriod or iOS) depending on this u have to design a separate theme for each system and then load this Theme according to that system.
this is the fast idea I try to fix this issue.

@NonameMissingNo
Copy link

@Ahmadmansoor The problem here is that the gradient isn't shown on iOS

@NonameMissingNo
Copy link

NonameMissingNo commented Jun 29, 2022

@Javierflo95 There is a problem with GradientBrushes on iOS and MacOS if used within a Frame.Background

@Ahmadmansoor
Copy link

Yes I know that, that why I told him to make difference theme , and load it according to the system, iOS is annoying system and most of time u can't get the design u dream , except one thing it has a nice true color 😀

@NonameMissingNo
Copy link

Yes, but the purpose of Maui would be to make those annoying quirks of iOS disappear, and have 1 unified system where everything looks how it should

@Ahmadmansoor
Copy link

Sorry but as always nothing perfect , this is the life 😉

@NonameMissingNo
Copy link

Huh, if I put the app in the background, and then come back, the gradient appears... (main branch)
image

@Javierflo95
Copy link
Author

Javierflo95 commented Jun 29, 2022

@NonameMissingNo , what do you mean, with if you put the app in background...

@Javierflo95 Javierflo95 changed the title Design differences between Adnroid and iOS Design differences between Android and iOS Jun 29, 2022
@rachelkang rachelkang changed the title Design differences between Android and iOS Gradient not appearing on iOS Jun 30, 2022
@rachelkang rachelkang added platform/android 🤖 area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Jun 30, 2022
@NonameMissingNo
Copy link

@rachelkang Are you sure that the iOS issue requires an android tag?

@jsuarezruiz
Copy link
Contributor

The problem is the Frame not rendering the gradient on iOS. The issue should be fixed by #7925

@jsuarezruiz jsuarezruiz added this to the 6.0-sr3 milestone Jun 30, 2022
@Javierflo95
Copy link
Author

The problem is the Frame not rendering the gradient on iOS. The issue should be fixed by #7925

Thanks @jsuarezruiz

@Javierflo95
Copy link
Author

@jsuarezruiz

another difference that I see is with the textbox (editors) see bellow
image

And when I use my app and go to login page, and then click on LOG IN in Android work well in API 31 but when I click on thiis iOS or Android API 28 the button doesn't work well :(

Any suggestions?

@mattleibow mattleibow modified the milestones: 6.0-sr3, 6.0-servicing Aug 29, 2022
@Redth Redth modified the milestones: 6.0-servicing, Backlog Aug 30, 2022
@ghost
Copy link

ghost commented Aug 30, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@jsuarezruiz
Copy link
Contributor

he button doesn't work well

Could you describe with more details the problem?, cannot click the button?

@hermben
Copy link

hermben commented Sep 19, 2022

As a workaround, you can replace Frame with ContentView to see if it also works for you:
Example code:

<ContentView
                HeightRequest="120"
                HorizontalOptions="FillAndExpand"
                Margin="-2"
                Padding="20, 45, 20, 0">
            <ContentView.Background>
                <LinearGradientBrush>
                    <GradientStop Color="#00A7B5" Offset="0.1" />
                    <GradientStop Color="#721474" Offset="1.0" />
                </LinearGradientBrush>
            </ContentView.Background>
</ContentView>

If you need border, border radius and shadow, you can combine ContentView with Border and Shadow MAUI elements.

@Javierflo95
Copy link
Author

Javierflo95 commented Sep 20, 2022

Could you describe with more details the problem?, cannot click the button?

@jsuarezruiz
The Button appear well, but when you click on it, the button on iOS it does not anything

@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2022
@samhouts samhouts added the fixed-in-7.0.58 Look for this fix in 7.0.58! label Feb 16, 2023
@samhouts samhouts modified the milestones: Backlog, .NET 7 + Servicing Feb 16, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! label Feb 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing fixed-in-7.0.58 Look for this fix in 7.0.58! fixed-in-7.0.100 fixed-in-7.0.101 fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! platform/iOS 🍎 t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants