0

透明な WebView 要素を作成する方法を知りたいのですが (透明なウィンドウのように...)、次のようなことを試します:

       Rectangle {
           id: webBrowser
           width: 100; height: 100
           color: "red"
           WebView {
               html: "<style>body,html{background:transparent;background-color: rgba(1,255,0,0.5;)} </style><p>Hello</p>"
             //     preferredWidth: 50
              //    preferredHeight: 50
anchors.fill: parent

           }
       }

しかし、それは役に立たないようです=( WebViewを透明にするにはどうすればよいですか?

4

1 に答える 1

1

HTMLコンテンツだけでなく、WebView自体の不透明度を設定する必要があります。

WebView {
   opacity: 0.5;
   html: "<style>body,html{background:transparent;background-color: 
         rgba(1,255,0,0.5;)} </style><p>Hello</p>"
   anchors.fill: parent
   }
于 2012-04-26T09:20:13.190 に答える