Force orientation

I have kind of a weird issue. I’m using webPopUp and am in landscape orientation. What is happening is when I load the webPopUp, the html page I’m loading is loading in portrait mode. When i rotate the device to the other landscape, the content automatically adjusts and then fits properly. Rotate back, and it still fits properly. Just the initial loading of the html content is thinking it’s in portrait mode for some reason. Very odd. And to make things worse, i’m only getting this on the iPhone, but on the iPad, it works great!

So is there a way to force the device to switch orientations and then back to kind of “refresh”? I don’t know. I can’t think of anything else at this point.

Here’s my code if someone is brave enough to take a stab at it. Thanks in advance.

[code]

module(…, package.seeall)

local widget = require(“widget”)
widget.setTheme(“theme_ios”)
local director = require “director”


function new()
localGroup = display.newGroup()

local myText = display.newText("", centerX, centerY, native.systemFont, 50)
myText:setTextColor(255, 255, 255)

myText.text = “click here for Africa Photos Page”
myText.size = 60
localGroup:insert(myText)

local function goToFlickr ()
native.showWebPopup( screenLeft,screenTop, display.contentWidth, display.contentHeight-36,
http://m.flickr.com/photos/awana_international/6059839284/lightbox/”,
{urlRequest=listener} )

end

function localGroup:clean()
native.cancelWebPopup()
_G.webPopup = false
end

myText:addEventListener( “tap”, goToFlickr)

return localGroup

end [import]uid: 90878 topic_id: 19919 reply_id: 319919[/import]

Interesting - what version of Corona are you currently using? [import]uid: 52491 topic_id: 19919 reply_id: 77494[/import]

I’m using .711

If it helps, I can send you my project files. Thanks so much Peach! Your a rockstar! I’ve been following some of your forums since Game Salad. [import]uid: 90878 topic_id: 19919 reply_id: 77541[/import]

Interesting indeed. Especially the part about rotation.
How do you handle the changing width and height?
If I rotate the phone using a web popup it keeps the portrait dimensions, making it too tall and too narrow in landscape mode.

[import]uid: 67504 topic_id: 19919 reply_id: 77553[/import]

Well, I’m not actually coding anything for the change in rotation. In my build settings I just have it configured for landscapeRight and landscapeLeft. When the user rotates the phone, it automatically orientates itself. Then when the webpopup rotates as well, it scales up properly. So i haven’t really coded anything. Thanks kind of my question, do i need to do something? [import]uid: 90878 topic_id: 19919 reply_id: 77556[/import]

Hey again,

Thanks for the kind words :slight_smile:

I have one last question before I go and try to replicate this myself this evening - do you get the issue when you are not using widgets or director?

Peach [import]uid: 52491 topic_id: 19919 reply_id: 77696[/import]

No, not using widgets or director seemed to make a difference for me.
Thanks so much for your help. [import]uid: 90878 topic_id: 19919 reply_id: 77745[/import]

This sounds like it may be a director issue, then. Some people have reported issues with director and widgets.

You may want to post about this in the Director subforum?

Peach :slight_smile: [import]uid: 52491 topic_id: 19919 reply_id: 77974[/import]

Hi Peach

I don’t think it’s a director or widgets. I created a separate project with out any widgets or using director. A simple, click the button and call the popup.

My only other thought was maybe it’s a flickr website error. But still not sure why if you rotate the phone, it updates perfectly.

I’m stumped. [import]uid: 90878 topic_id: 19919 reply_id: 78314[/import]

Yeah, that sounds like an issue - can you please file a bug report using the link in the top left? [import]uid: 52491 topic_id: 19919 reply_id: 78334[/import]

I filed a bug. Thanks. [import]uid: 90878 topic_id: 19919 reply_id: 78349[/import]