webview

I use WebView, access to URL, the page is always flashing, please help .The link I used in the page is as follows

<a href=zyref:110090>one</a><br>
<a href=zyref:110085>two</a><br>

any help?

I’m full of hope. I hope to solve my confusion. But did not expect, actually so cold.

I would recommend reading this post:  https://forums.coronalabs.com/topic/55780-ask-a-better-question-get-a-better-answer/

You’ve not given us anything to go on.

What is flashing? What do you mean by flashing?

What is the URL?

The HTML you posted isn’t valid. There needs to be quotes around the URL.

What kind of URL is that?

Is it a URL Scheme for your app? or some other app?

What are you expecting to see?

What are you actually seeing?

Can you show more code to give us context?

Oh, and what version of Corona SDK.

Are you developing on Windows or a Mac?

What device are you testing?

OS?

Version?

Thank you,Rob Miracle.

There is no problem in the simulator.(Mac version 10.11.5 )(corona sdk v2016.2830)

Publish to device,Feel the page refresh.

This is my code.


local composer = require(“composer”)
local scene = composer.newScene()

function scene:create(event)
local zygroup = self.view

backgroundImage = display.newImageRect(“bg.png”,1024,768)
zygroup:insert(backgroundImage)
backgroundImage.x = 512
backgroundImage.y = 384

wenben = display.newText( “return”, 700, 500, native.systemFont, 48 )
wenben:setFillColor( 1, 0, 0 )
zygroup:insert(wenben)
end

local function webListener( event )
local url = event.url
if 1 == string.find( url, “zyref:” ) then
print(url)
end
end

local function wenbenmousedown()
composer.gotoScene( “main2”)
composer.removeScene(“hzzy”)
end

function scene:show(event)
local zygroup = self.view

local phase=event.phase
if (phase==“will”) then
webView = native.newWebView(320, 384,180,400 )
webView:request( “2.html”,system.ResourceDirectory )
zygroup:insert(webView)
elseif(phase==“did”) then
wenben:addEventListener( “tap”, wenbenmousedown)
webView:addEventListener( “urlRequest”, webListener )
end
end

function scene:hide(event)
wenben:removeEventListener(“tap”, wenbenmousedown)
end
function scene:destroy(event)
end
scene:addEventListener(“create”, scene)
scene:addEventListener(“show”, scene)
scene:addEventListener(“hide”, scene)
scene:addEventListener(“destroy”, scene)
return scene

—2.html
<html>
<head>
<meta name=“viewport” content=“width=160; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;” />
</head>
<meta http-equiv=“content-type” content=“text/html; charset=utf-8”>
<style>
@import URL(“style.css”);
HTML,BODY {
SCROLLBAR-FACE-COLOR: #fcb424;
SCROLLBAR-HIGHLIGHT-COLOR: #4848d8;
SCROLLBAR-SHADOW-COLOR: #b4906c;
SCROLLBAR-3DLIGHT-COLOR: #F8E2A1;
SCROLLBAR-ARROW-COLOR: #900000;
SCROLLBAR-TRACK-COLOR: #F8E2A1;
SCROLLBAR-DARKSHADOW-COLOR: #b4486c;
SCROLLBAR-BASE-COLOR: #fc2400
}
</style>
</head>
<body>
<a href=zyref:110074>one</a><br>
<a href=zyref:110103>two</a><br>
<a href=zyref:110090>three</a><br>
</body>

You still didn’t answer a lot of the questions or replied as if you had read the post I asked you to read. You’re code is hard to follow since you didn’t use code tags (talked about in the post too).

I still don’t know what you mean by blinking?

What’s going on in style.css?

any help?

I’m full of hope. I hope to solve my confusion. But did not expect, actually so cold.

I would recommend reading this post:  https://forums.coronalabs.com/topic/55780-ask-a-better-question-get-a-better-answer/

You’ve not given us anything to go on.

What is flashing? What do you mean by flashing?

What is the URL?

The HTML you posted isn’t valid. There needs to be quotes around the URL.

What kind of URL is that?

Is it a URL Scheme for your app? or some other app?

What are you expecting to see?

What are you actually seeing?

Can you show more code to give us context?

Oh, and what version of Corona SDK.

Are you developing on Windows or a Mac?

What device are you testing?

OS?

Version?

Thank you,Rob Miracle.

There is no problem in the simulator.(Mac version 10.11.5 )(corona sdk v2016.2830)

Publish to device,Feel the page refresh.

This is my code.


local composer = require(“composer”)
local scene = composer.newScene()

function scene:create(event)
local zygroup = self.view

backgroundImage = display.newImageRect(“bg.png”,1024,768)
zygroup:insert(backgroundImage)
backgroundImage.x = 512
backgroundImage.y = 384

wenben = display.newText( “return”, 700, 500, native.systemFont, 48 )
wenben:setFillColor( 1, 0, 0 )
zygroup:insert(wenben)
end

local function webListener( event )
local url = event.url
if 1 == string.find( url, “zyref:” ) then
print(url)
end
end

local function wenbenmousedown()
composer.gotoScene( “main2”)
composer.removeScene(“hzzy”)
end

function scene:show(event)
local zygroup = self.view

local phase=event.phase
if (phase==“will”) then
webView = native.newWebView(320, 384,180,400 )
webView:request( “2.html”,system.ResourceDirectory )
zygroup:insert(webView)
elseif(phase==“did”) then
wenben:addEventListener( “tap”, wenbenmousedown)
webView:addEventListener( “urlRequest”, webListener )
end
end

function scene:hide(event)
wenben:removeEventListener(“tap”, wenbenmousedown)
end
function scene:destroy(event)
end
scene:addEventListener(“create”, scene)
scene:addEventListener(“show”, scene)
scene:addEventListener(“hide”, scene)
scene:addEventListener(“destroy”, scene)
return scene

—2.html
<html>
<head>
<meta name=“viewport” content=“width=160; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;” />
</head>
<meta http-equiv=“content-type” content=“text/html; charset=utf-8”>
<style>
@import URL(“style.css”);
HTML,BODY {
SCROLLBAR-FACE-COLOR: #fcb424;
SCROLLBAR-HIGHLIGHT-COLOR: #4848d8;
SCROLLBAR-SHADOW-COLOR: #b4906c;
SCROLLBAR-3DLIGHT-COLOR: #F8E2A1;
SCROLLBAR-ARROW-COLOR: #900000;
SCROLLBAR-TRACK-COLOR: #F8E2A1;
SCROLLBAR-DARKSHADOW-COLOR: #b4486c;
SCROLLBAR-BASE-COLOR: #fc2400
}
</style>
</head>
<body>
<a href=zyref:110074>one</a><br>
<a href=zyref:110103>two</a><br>
<a href=zyref:110090>three</a><br>
</body>

You still didn’t answer a lot of the questions or replied as if you had read the post I asked you to read. You’re code is hard to follow since you didn’t use code tags (talked about in the post too).

I still don’t know what you mean by blinking?

What’s going on in style.css?