Skip to content

[Android] Controls Disappear When WebView is Used with Hardware Acceleration Disabled #28934

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

praveenkumarkarunanithi
Copy link
Contributor

Root Cause

When android:hardwareAccelerated="false" is set in Android applications, standard UI elements switch to software rendering, but WebView may continue using hardware optimization. This inconsistency causes WebView to occasionally render above other UI elements, disrupting the expected visual hierarchy.

Description of Change

The solution involves setting the WebView to use the software rendering pipeline by applying SetLayerType(Android.Views.LayerType.Software, null) when hardware acceleration is disabled. This ensures that WebView aligns with the rendering behavior of other UI elements, maintaining correct layering and preventing any UI components from being obscured.

Issues Fixed

Fixes #28902

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Note

This issue is specific to Android, as hardware acceleration settings are not applicable on other platforms.

Screenshots

Before Issue Fix After Issue Fix
withoutfix withfix

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Apr 11, 2025
Copy link
Contributor

Hey there @@praveenkumarkarunanithi! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Apr 11, 2025
@praveenkumarkarunanithi praveenkumarkarunanithi marked this pull request as ready for review April 14, 2025 12:54
@Copilot Copilot bot review requested due to automatic review settings April 14, 2025 12:54
@praveenkumarkarunanithi praveenkumarkarunanithi requested a review from a team as a code owner April 14, 2025 12:54
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-webview WebView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android 🤖
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Control disappears when android:hardwareAccelerated="false"
2 participants