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 fill property #14099

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

feat(android): webview fill property #14099

wants to merge 2 commits into from

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 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({
	fill: true,
	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

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%)
1 participant