I have some strange bug in the Titanium...
I have a window, I added a webview to the window.
Now,when I close the window & then coming back to the window
the webview is gone... :-(
Anyone ideas??
Thanks
Code:
var main = Titanium.UI.createWindow({....});
var webview = Titanium.UI.createWebView({...});
main.add(webview);
Now after those declarations:
main.close();
and after this:
main.open();
somehow the main window losing the webview...
try
main.relase(webview);
before closing and then add again on opening.
or just hide as MZ suggested.
Related
I've got a webview that changes it's content when a button is pressed inside the webview. Is it possible to detect if webview has changed its content in XCUITest.
Edit: I would like a general way to know if the webview has updated without having to know the content the webview will update to–prior to the update.
Sure !
You can get your webview doing something like this:
let webview = app.webviews.firstMatch
Then, you can do some assertions on the webview content:
webview.staticTexts["TestString"].firstMatch.exists
I am facing a problem very similar to what was reported and resolved in this SO Question: iOS 11 Safari bootstrap modal text area outside of cursor
. However, the difference for me is that I am using Aurelia & Semantic UI.
I have tried using position: fixed in ux-dialog-body as described in several fixes for the problem occuring in bootstrap (in those examples to be added to the body of the modal), however that did not work.
I would appreciate any help on this issue, thanks in advance.
So I got the idea for the fix here : Semantic-Org/Semantic-UI-React
Basically the problem relates to the height of the content behind the modal/what the modal is lying on top of. So, hide all of it when opening the Modal and put it back when done. However, only for iOS, because for some reason on our site doing otherwise breaks Android devices.
iOS: boolean = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
In opening the modal
if (this.iOS) {
$('body > :not(ux-dialog)').hide();
$("ux-dialog").show();
}
And closing
if (this.iOS) {
$('body > :not(ux-dialog)').show();
$("ux-dialog").hide();
$("ux-dialog-overlay").hide();
$("ux-dialog-container").hide();
}
I hope this helps someone else.
I've a problem, i need to open url inside app, and I used a WebView, but doesn't work correctly.
imported this:
import QtWebView 1.0
my code:
Rectangle{
width: Screen.width
height: Screen.height
color: "Orange"
anchors.fill: parent
z:9999999
WebView {
id: webviewer
anchors.fill: parent
url: "http://www.google.com"
onLoadProgressChanged: {
console.log(webviewer.loadProgress)
}
}
}
and in the .pro file i've put:
QT += webview
And my main.cpp
QtWebView::initialize();
my console.log is printing correctly the load status, but on the screen I don't see nothing.
Why?
Works on iOS, the solution is:
Open project in Xcode from build folder, and set App Transport Security Settings, you must add Allow Arbitrary Loads and sets it on YES.
Now the WebView works.
initialize() creates opengl surface, in this case You must first open parent window(surface to display) , other solution is to comment initialize() - page will show. If you'll decide to show it on GL surface, try to se ALWAYSSTACKONTOP attribute to see, if other windows dont cover webview, opengl is rendered first,so any other background can make it not visible. You may also open webview class parented to other, visible window, but if you will show it fullscreen, it will be flicker a while
When I am loading a URL in WebView for Android Lollipop 5.0, it shows a popup to choose a browser instead of showing the content in WebView itself. The same code was working fine in all earlier versions. What might be causing this?
Any help will appreciate.
this works for me
WebView webView = (WebView) findViewById(R.id.webLink);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl(url);
I need to set the background of a window to be transparent programmatically, once the window is already created.
This creates a new window with a transparent background.
Titanium.UI.createWindow({url:location.href,transparentBackground:true}).open()
Background transparency can also be set in the tiapp.xml, but I need to set it after the window is loaded.
I also tried the following
var win = Titanium.UI.getCurrentWindow();
win.backgroundColor = 'transparent';
which does not have any effect...
Is there a way to achieve that?
Perhaps you could create 2 windows with the same components, one transparent and one not. Once you want the transparent background to show close the other window?
or win.setBackgroundColor('transparent');
I pasted your code into a click event and it worked fine for me. All i did was change the url to 'app://index.html' for testing purposes.
$('.button').click(function(){
// test
Titanium.UI.createWindow({url:'app://index.html',transparentBackground:true}).open();
});
Have you opened the web inspector to check for js errors?
If you want the initial window to be transparent, add this
<transparent-background>false</transparent-background>
to
<window />
on the tiapp.xml file.