Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-26-2011, 01:46 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Location: Marquette, MI (in the beautiful Upper Peninsula)
Posts: 111
john love is on a distinguished road
Default UIWebview rotation

Two questions about my UIWebview ... FWIW, my webView is not the whole view, but part of it.

1) My html specifies width:auto which stands for 100% of the view port. Yet, when I rotate the device, the content of the webView does not fill out to the width of the Landscape config ... it stays the same as the width it had in Portrait ... in short, in the center

2) With rotation, the delegate method -didRotateFromInterfaceOrientation is called. Do I need to do something special within this method?
john love is offline   Reply With Quote
Old 08-26-2011, 02:13 PM   #2 (permalink)
Registered Member
 
Join Date: Dec 2010
Posts: 7
BojanG is on a distinguished road
Default

Do you have the autosizing options of the UIWebView configured?
BojanG is offline   Reply With Quote
Old 08-27-2011, 09:57 AM   #3 (permalink)
Registered Member
 
Join Date: Jul 2011
Location: Marquette, MI (in the beautiful Upper Peninsula)
Posts: 111
john love is on a distinguished road
Default

Yes ... but I've always had a problem getting my arms around autoresizing. After your suggestion, I revisited autoresizing and:

1) horizontal spring = ON

2) arrange: fill container horizontally

for both the web view and the whole enclosing view.

Bingo! but I've got to now work on the other sub-views and find some more articles about autoresizing.

Thanks again,
john love is offline   Reply With Quote
Old 09-07-2011, 08:10 AM   #4 (permalink)
Registered Member
 
Join Date: Jul 2011
Location: Marquette, MI (in the beautiful Upper Peninsula)
Posts: 111
john love is on a distinguished road
Default

The light bulb started to come on. Unfortunately, I have not discovered a uniform way to correct the problem, as described below.

I believe that my whole problem centers on my autoresizingMasks. And the reason I have concluded that is the same symptoms exist, with or without a UIWebView. And that symptom is that everything is peachy for Portrait. For Landscape, the bottom-most UIButton pops down behind the TabBar.

For example, on one UIView, I have, from top to bottom:

UIView – both springs set (default case) and no struts

UIScrollView -
If I set the two springs, and clear everything else (like the UIView), then the UIButton intrudes on the object immediately above it.
If I clear everything, then UIButton is OK, but the stuff at the very top hides behind the StatusBar
Setting only the top strut, the UIButton pops down behind the Tab Bar.

UILabel and UIImage next vertically – top strut set, flexible everywhere else

Just to complete the picture for the few that have a UIWebView:

UIWebView -
Struts: top, left, right
Springs: both

UIButton – nothing set, i.e., flexible everywhere

Although my light bulb is dim, there appears to be hope.

Last edited by john love; 09-07-2011 at 08:34 AM.
john love is offline   Reply With Quote
Old 09-09-2011, 12:17 PM   #5 (permalink)
Registered Member
 
Join Date: Jul 2011
Location: Marquette, MI (in the beautiful Upper Peninsula)
Posts: 111
john love is on a distinguished road
Default

After about 2 weeks on tackling this, I decided that the "problem" was made more difficult by placing a UIButton BELOW the UIWebView sub-view. So, I put the button ABOVE it.

Quite frankly, it just doesn't look "right" that way ... but it now works SORT OF. BELOW or ABOVE the UIWebView has set the top strut and just the horizontal spring.

BTW, its the contentHeight of the UIWebView that does not change with rotation. And that's still true even with button ABOVE.

Set top strut and set the two springs - problem solved and thanks bunches.

As a matter of fact, my only remaining problem is to design those cursed @2X, etc. graphics. I use GraphicConverter in a very simple way and it does well for Web Page design, very well. But all these 30px, 57px stuff - I'm going into unchartered territory for me, at least.

Last edited by john love; 09-10-2011 at 05:11 AM.
john love is offline   Reply With Quote
Reply

Bookmarks

Tags
uiwebview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 392
16 members and 376 guests
7twenty7, chiataytuday, cristofercolmbos, dedeys78, fiftysixty, gmarro, iOS.Lover, jonathandeknudt, kilobytedump, Matrix23, raymng, ryantcb, stanny, tymex, UMAD, xerohuang
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,669
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dedeys78
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:14 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0