native.newWebView( ) help

This may very well have already been answered… But I’ll admit, I’m a bit too tired to go look…

I’m trying to use: native.newWebView( )

to load in a web page. I see the web page load, then it immediately loads Safari and goes to one of the links on the page. After some research, the page has an iframe in it and instead of the iframe showing in the page, newWebView() appears to be trying to load the iFrame in Safari.

any way to fix this?

Thanks
Rob
[import]uid: 19626 topic_id: 27015 reply_id: 327015[/import]

Sample code? [import]uid: 8271 topic_id: 27015 reply_id: 109653[/import]

I hate to admit defeat, and I don’t want to put too much effort into this, so I punted using newWebView() and fell back to using native.showWebPopUp() to solve most of my issues.

Now I’m left with one problem I don’t understand (and you will get code this time!)

config.lua:

if system.getInfo("model") == "iPad" then  
 application =   
 {  
 content =  
 {  
 width = 768,  
 height = 1024,  
 scale = "letterbox",  
 },  
 }   
else  
 application =   
 {  
 content =  
 {  
 width = 768,  
 height = 1152,  
 scale = "letterbox",  
 },  
 }  
end  

All of my backgrounds are setup to have bleeds and are 1152x768. This should let everything I do scale to 768px

In my menu.lua Storyboard based page:

function scene:enterScene( event )  
 local group = self.view  
 if storyboard.isNetActive then  
 native.showWebPopup( 0, 0, 700, 140,   
 "http://www.technolio.com/banners/bannerIII.html",   
 {urlRequest=webListener} )  
 end  
end  

In bannerIII.html:

  
[html]

<title>Technolio Banner III</title>
  
<meta name="viewport" content="width=700px; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
  
<style type="text/css"> <br> html { -webkit-text-size-adjust: none; }<br> body { margin: 0; padding: 0; background-color: black; width: 700px; height: 140px; }<br></style>
  
  
  
[  
 ![](/images/banner.gif)  
](itms-apps://phobos.apple.com/WebObjects/MZSearch.woa/wa/search?media=software&term=technolio%20inc)  
  
[/html]  

** I have removed a bunch of irrelevant code from the HTML.

On the iPad, the ad shows in the 700x140 box just spiff. If I view it on the iPhone 4, the ad is twice the size it should be.

Now both devices should be on the same scale, just adjusted for the aspect ratio.

I specifically set the width to 700px for the viewport. I specifically set the body to 700px wide and I specifically set the image to 700 pixels and it is natively 700 px wide.

Why am I doubling up on the iPhone?


If I go into Firebug and hit the web page directly, all of my expected sizes are correct.

Any ideas? webview’s should not be sooooo difficult.

Thanks in advance!!!
Rob
EDIT: Oh. my iPad is a new one with a retina display which is why it’s physically twice as big, but… [import]uid: 19626 topic_id: 27015 reply_id: 109925[/import]

Any one? Bueller?

I just want to load in a web page and have it take up 100% of my webView regardless of what phone or device I’m on. This shouldn’t be hard and should be something someone has already solved…

Thanks
Rob [import]uid: 19626 topic_id: 27015 reply_id: 110059[/import]

You need to check the device dimensions in both the Corona code (to size the webview properly) and again in the HTML (to size the web page properly.)

This might help:

https://developer.anscamobile.com/code/orientation-rotation-web-popup [import]uid: 8271 topic_id: 27015 reply_id: 110077[/import]

Thanks @horacebury, but the code in your orientation rotation really doesn’t seem applicable to my problem.

Now at least, I have the graphic smaller than the target area and it seems to be consistent across platforms. I removed the viewport tag completely. I think there are caching issues adding to my frustration. I make changes and I don’t see them right away.

Though to my surprise, native.showWebPopup appears to actually work in the simulator now.

I wish native.newWebView would and that it would be androidized sooner than later. I can’t switch to it since I need it to be Kindle friendly.

Surely someone has some experience loading stuff into webPopup’s. [import]uid: 19626 topic_id: 27015 reply_id: 110325[/import]