Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(android): webview content will fill up the whole Ti.UI.WebView by default #14099

Merged
merged 6 commits into from
Nov 9, 2024

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Aug 29, 2024

Fixes #14098

The Webview content is not filling up the whole space so it can be used with 100% values. If you use px values it will work. If you inspect the element before this PR you'll see it doesn't have a height:

Bildschirmfoto_20240829_225345
(it still renders the background color but the inner DOM elements can't handle % values).

After this PR it will fill up the whole webview (e.g. Ti.UI.FILL, nothing, or a number value) and the elements inside will respond to percentage values.

Bildschirmfoto_20240829_225547

Test

var w = Ti.UI.createWindow({});
var h = Ti.UI.createWebView({
	html: '<meta name="viewport" content="width=device-width, initial-scale=1"><body style="background-color:red">  <canvas style="width: 100%; height: 100%; background-color:blue"></canvas></body>'
});
w.add(h);
w.open();
  • run this in the current SDK -> red webview
  • run this PR -> blue canvas is visible

apidoc/Titanium/UI/WebView.yml Outdated Show resolved Hide resolved
@m1ga m1ga changed the title feat(android): webview fill property feat(android): webview body will fill up the whole Ti.UI.WebView by default Nov 9, 2024
@m1ga m1ga changed the title feat(android): webview body will fill up the whole Ti.UI.WebView by default feat(android): webview content will fill up the whole Ti.UI.WebView by default Nov 9, 2024
Copy link
Collaborator

@hansemannn hansemannn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks!

@hansemannn hansemannn merged commit c817069 into master Nov 9, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android: A canvas inside a local webview has the wrong height if it is specified using percentages (i.e. 100%)
2 participants