Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Transparency: Different behaviour of Android vs Webview

$
0
0

Hello Friends,

TL;DR: Code at bottom doesn't behave as expected: In Android Emulator (2.3), The opacity is ignored. Making whole window opaque works, so does webview. Both noth what wanted :(

I have a quite irritating problem. For learning purposes, I try to create different, common working scenarios. One of them is the popup.

To approach this, I have (see below): - A normal window - A code created window - A code created button within this new window

I want: - A semi-transparent overlay ( opacity ) to make clear that the rest of the app is temporarily not available - The effect, that the popup closes without action - in the middle a custom layer

The good news is: I managed to do all of this!

var window = Titanium.UI.createWindow({
        modal : false,
        backgroundColor : 'transparent' // Source: Some Forum/google as a fix attemp. Does not work.
        //opacity: 0.5 // <-- this works but for everything
    });
 
    var label = Titanium.UI.createLabel({
        text : '',
        id : 'overlayBackground',
        width : Ti.UI.FILL,
        height : Ti.UI.FILL,
        color : 'yellow',
        backgroundColor : 'yellow',
        opacity : 0.60 // <-- this one works in web but not for android
    });
 
    label.addEventListener("click", function(e) {
        window.close();
    });
 
    window.add(label);
    window.add(webview); // webview is simply a simplet from wikipedia for testing purpose
    window.open();

Intended behaviour: Webview is not transparent, background is semi-transparent Real behaviour: Everything is solid

Any tips are very welcome!

Thanks


Viewing all articles
Browse latest Browse all 8068

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>