Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[iOS] Avoid setting embedding view controller background color #14761

Closed
wants to merge 2 commits into from

Conversation

GalaxiaGuy
Copy link
Contributor

@GalaxiaGuy GalaxiaGuy commented Oct 19, 2021

Description of Change

Changes the UIViewController created when embedding a Page on iOS to not explicitly set a background color (it was preventing embedding a transparent page).

Issues Resolved

Platforms Affected

  • iOS

Behavioral/Visual Changes

Pages that are transparent and embedded in iOS will now appear transparent.

Testing Procedure

An option has been added to the iOS embedding test bed to display a transparent page. This also contains some semi-transparent boxes. It is shown over a yellow background that should be visible.

Additionally, other pages should be unaffected.

Simulator Screen Shot - iPod touch (7th generation) - 2021-10-25 at 19 26 50

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

@GalaxiaGuy
Copy link
Contributor Author

GalaxiaGuy commented Oct 20, 2021

I'm planning on adding a test case to the embedding test bed project.

Is any more functionality needed? This would be a change in behavior if someone set a background color on a page with alpha and relied on there being white behind it when embedding. Which seems unlikely...

Platform.WillAppear();
}

base.ViewWillAppear(animated);

if (!_disposed)
Copy link
Contributor Author

@GalaxiaGuy GalaxiaGuy Oct 25, 2021

Choose a reason for hiding this comment

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

Platform.WillAppear sets the view's background color to ColorExtensions.BackgroundColor so the background color has to be set to Clear after that.

Is Platform.WillAppear only used for embedding? If so it may be better to make the change there.

@GalaxiaGuy GalaxiaGuy marked this pull request as ready for review October 25, 2021 18:32
@jfversluis
Copy link
Member

Hey @GalaxiaGuy thanks for this one and thanks for your patience! I'm not going to last minute add this for the next service release, but I'll see about adding it to the next :)

@follesoe

This comment was marked as off-topic.

@jfversluis
Copy link
Member

Now that we're so close to the sunsetting of Xamarin.Forms unfortunately we won't be able to take this in anymore, we're really sorry about that. Nevertheless, thank you so much for your time and effort that you have put into this PR.

Please have a look at the evolution of Xamarin.Forms, .NET MAUI. A lot of development has been going on there. Hopefully this issue was already fixed in that codebase. If not, feel free to port this over to there.

Again, thank you so much for being a contributor and Xamarin.Forms user!

@jfversluis jfversluis closed this Apr 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [iOS] It is not possible to embed a transparent Page natively with a transparent background
4 participants