How to create a semi-transparent frame in Xamarin (XAML code)?
-
I have made a BMI calculator based on a tutorial from Youtube. I added a wallpaper to my app. I want to add a transparent frame to my background and all the controls would be put on that frame. I tried this code:
The problem is that all the child nodes get affected by opacity and marigin settings. I want to have opacity just in fram, not child nodes. Also, Child nodes must have their own padding. How to fix this problem?:confused:
-
I have made a BMI calculator based on a tutorial from Youtube. I added a wallpaper to my app. I want to add a transparent frame to my background and all the controls would be put on that frame. I tried this code:
The problem is that all the child nodes get affected by opacity and marigin settings. I want to have opacity just in fram, not child nodes. Also, Child nodes must have their own padding. How to fix this problem?:confused:
-
You need to specify the values for child controls, otherwise they inherit from the parent.
I added
Opacity ="1"
to each child control, but it doesn't take any effect and all the child controls are still semi-transparent.
-
I added
Opacity ="1"
to each child control, but it doesn't take any effect and all the child controls are still semi-transparent.
-
See the Remarks section at VisualElement.Opacity Property (Xamarin.Forms) | Microsoft Docs[^]
I read it. But I couldn't find any way to separate chide control opacity from its parent. Can you help me?
-
I read it. But I couldn't find any way to separate chide control opacity from its parent. Can you help me?
-
I have made a BMI calculator based on a tutorial from Youtube. I added a wallpaper to my app. I want to add a transparent frame to my background and all the controls would be put on that frame. I tried this code:
The problem is that all the child nodes get affected by opacity and marigin settings. I want to have opacity just in fram, not child nodes. Also, Child nodes must have their own padding. How to fix this problem?:confused:
One typically uses a "Style" to affect all instances of a given "type of control" within that Style's scope (e.g. "Padding"). [Styling Xamarin.Forms Apps - Xamarin | Microsoft Docs](https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/styles/)
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food