gpt4 book ai didi

html - 如何调用HTML网页来扩展和适合整个屏幕?

转载 作者:行者123 更新时间:2023-12-03 04:20:49 25 4
gpt4 key购买 nike

我有一个在Flutter应用中调用的HTML文件。
使用WebView提取文件时,我的输出如下图所示,并没有覆盖整个屏幕。
这是我的代码:

<html>
<head>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="https://s3.amazonaws.com/cdn.theoremreach/v3/theorem_reach.min.js"></script>
</head>
<body>
<iframe src="https://theoremreach.com/respondent_entry/direct?api_key=abc&user_id=12345"></iframe>
<script type="text/javascript">
var theoremReachConfig = {
apiKey: "abc",
userId: "12345",
onRewardCenterOpened: onRewardCenterOpened,
onReward: onReward,
onRewardCenterClosed: onRewardCenterClosed
};

var TR = new TheoremReach(theoremReachConfig);

function onRewardCenterOpened(){
console.log("onRewardCenterOpened");

}

function onReward(data){
window.postMessage(data.earnedThisSession)
console.log("onReward: " + data.earnedThisSession);
}

function onRewardCenterClosed(){
console.log("onRewardCenterClosed");
}

if (TR.isSurveyAvailable()) {
TR.showRewardCenter();
}

</script>
</body>
</html>
这是屏幕的样子:

我正在尝试在屏幕上放置整个WebView。

最佳答案

将其添加到您的头部应该可以正常工作。

<style>
iframe {
height:100%;
width:100%;
margin:0 auto;
position:absolute;
top:0;
left:0;
}
</style>

关于html - 如何调用HTML网页来扩展和适合整个屏幕?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62715141/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com