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

Opacity bug on BoxView.Background #19926

Closed
ShariatPanah opened this issue Jan 16, 2024 · 6 comments · Fixed by #21322
Closed

Opacity bug on BoxView.Background #19926

ShariatPanah opened this issue Jan 16, 2024 · 6 comments · Fixed by #21322
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing fixed-in-8.0.40 fixed-in-9.0.0-preview.4.10690 platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@ShariatPanah
Copy link

ShariatPanah commented Jan 16, 2024

Description

when i set the background of a boxview to a linear gradient brush, the opacity works on hotreload but when i stop the application and rerun it, the opacity would be ignored like it was never been set, this is my xaml code:

        <BoxView
            HeightRequest="200"
            Opacity="0.3"
            WidthRequest="150">
            <BoxView.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <GradientStop Offset="0.4" Color="Transparent" />
                    <GradientStop Offset="1" Color="Black" />
                </LinearGradientBrush>
            </BoxView.Background>
        </BoxView>

Steps to Reproduce

Just create a box view using my code snippet

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 12.0

Did you find any workaround?

No response

Relevant log output

No response

@ShariatPanah ShariatPanah added the t/bug Something isn't working label Jan 16, 2024
@ShariatPanah
Copy link
Author

ShariatPanah commented Jan 17, 2024

i tested on windows and boxview opacity works as expected, so apparently it's boxview's bug in android handler

@maxiking01
Copy link

I confirm that problem with BoxView's Opacity appears on Android. On iOS and Windows opacity is applied correctly. I tested on .Net 8.0.1 .

@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Jan 20, 2024
@returnZro
Copy link

Is there any work-around for this?

@awasilik
Copy link

awasilik commented Feb 22, 2024

I can observe the same issue in my application.
There is a workaround but it's unacceptable for me - I need to set the opacity again manually from code after the view is rendered.

@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Feb 29, 2024
@XamlTest
Copy link

Verified this on 8.0.6. Repro on Android 14.0-API34, not repro on Windows, iOS 17.2 and MacCatalyst with below Project:
OpacityIssue.zip

kubaflo added a commit to kubaflo/maui that referenced this issue Mar 20, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue Mar 20, 2024
@kubaflo
Copy link
Contributor

kubaflo commented Mar 20, 2024

@awasilik @ShariatPanah this pr might help :) #21322

kubaflo added a commit to kubaflo/maui that referenced this issue Mar 24, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue Mar 24, 2024
@PureWeen PureWeen added this to the Backlog milestone Mar 25, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue Apr 10, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue Apr 10, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue Apr 10, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue Apr 10, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue Apr 10, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue Apr 10, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue Apr 10, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue Apr 10, 2024
github-actions bot pushed a commit to kubaflo/maui that referenced this issue Apr 13, 2024
github-actions bot pushed a commit to kubaflo/maui that referenced this issue Apr 13, 2024
github-actions bot pushed a commit to kubaflo/maui that referenced this issue Apr 13, 2024
github-actions bot pushed a commit to kubaflo/maui that referenced this issue Apr 13, 2024
PureWeen pushed a commit that referenced this issue Apr 13, 2024
* Added a Ui Test (#19926)

* [Android] box view properties fix (#19926)

* Revert "[Android] box view properties fix (#19926)"

This reverts commit 1995547.

* Update BoxView (#19926)

* Update BoxView.cs

* Added snapshot

---------

Co-authored-by: Javier Suárez <[email protected]>
@github-project-automation github-project-automation bot moved this from Todo to Done in MAUI SDK Ongoing Apr 13, 2024
@Eilon Eilon added area-controls-boxview area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing and removed legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor area-controls-boxview labels May 13, 2024
@samhouts samhouts modified the milestones: Backlog, .NET 8 SR5 May 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 15, 2024
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-8.0.40 fixed-in-9.0.0-preview.4.10690 platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

9 participants