Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Android
  4. How to create a semi-transparent frame in Xamarin (XAML code)?

How to create a semi-transparent frame in Xamarin (XAML code)?

Scheduled Pinned Locked Moved Android
helptutorialmobilewpfquestion
7 Posts 2 Posters 25 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alex Dunlop
    wrote on last edited by
    #1

    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:

    L 2 Replies Last reply
    0
    • A Alex Dunlop

      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:

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You need to specify the values for child controls, otherwise they inherit from the parent.

      A 1 Reply Last reply
      0
      • L Lost User

        You need to specify the values for child controls, otherwise they inherit from the parent.

        A Offline
        A Offline
        Alex Dunlop
        wrote on last edited by
        #3

        I added

        Opacity ="1"

        to each child control, but it doesn't take any effect and all the child controls are still semi-transparent.

        L 1 Reply Last reply
        0
        • A Alex Dunlop

          I added

          Opacity ="1"

          to each child control, but it doesn't take any effect and all the child controls are still semi-transparent.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          See the Remarks section at VisualElement.Opacity Property (Xamarin.Forms) | Microsoft Docs[^]

          A 1 Reply Last reply
          0
          • L Lost User

            See the Remarks section at VisualElement.Opacity Property (Xamarin.Forms) | Microsoft Docs[^]

            A Offline
            A Offline
            Alex Dunlop
            wrote on last edited by
            #5

            I read it. But I couldn't find any way to separate chide control opacity from its parent. Can you help me?

            L 1 Reply Last reply
            0
            • A Alex Dunlop

              I read it. But I couldn't find any way to separate chide control opacity from its parent. Can you help me?

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Sorry, I have never used it. But the remarks suggest you need a higher value for the child. Try some different numbers to see which one works.

              1 Reply Last reply
              0
              • A Alex Dunlop

                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:

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups