4

I kind of stuck with a design issue in iOS.

I have a controller with a background image, nothing special.

this.View.BackgroundColor = UIColor.FromPatternImage (UIImage.FromFile ("Images/ballons.jpg"));

On top of the controller I have a view with a background color (white) that is semi-transparent.

this.Frame = new System.Drawing.RectangleF (0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height);
this.BackgroundColor = UIColor.White;
this.Alpha = 0.5f;

Now the issue is if I add a button or any other controls in my view they also becomes transparent...so am I thinking wrong here...?

I would like the controller to have a background image, the view a white semi-transparent background and all the controls (buttons, images) not to be transparent at all...

Grendizer
  • 2,173
  • 3
  • 16
  • 18

1 Answers1

6

Do not change the Alpha of the view, since that will change the transparency of all its elements/subviews. Just set its BackgroundColor to a semi-transparent color using UIColor.FromWhiteAlpha(1, 0.5).

xissburg
  • 618
  • 5
  • 14
  • That makes the whole background white. Even if I set the color to "Clear" it still a white background. Is there any other way to handle it? – Pavlos Mavris Feb 03 '23 at 13:30