[iPhone] Autorotation and Problem Resizing UIWebView

I'm loading a UIViewController with a UIWebView embedded in it. However, the UIWebView doesn't always resize correctly. Here are the steps I follow:
a) I view the UIWebView in portrait mode...
b) I autorotate to landscape mode...
c) I load a new HTML string using [webView loadHTMLString:self.htmlText baseURL:nsurl];
webView is an instance of UIWebView.
nsurl points to a local HTML file.
d) I rotate back to portrait mode... this is where the text extends beyond the right border of the screen. It appears that the UIWebView keeps the horizontal landscape dimensions after I rotate back to portrait mode.
The strange thing is that this only happens after I call [webView loadHTMLString:self.htmlText baseURL:nsurl];
I'm running the latest OS and the programming using the newest SDK.
Any thoughts?

The solution to my other UIWebView/Autorotation problem also solved this. I added the viewport meta tag to each HTML page. I dynamically changed this tag using some javascript every time the device rotated and explicitly set the width to 320 and height to 480, or vice versa. If you use this solution, make sure you include spaces before and after the "=" in the meta tag. See the examples on the following page: http://developer.apple.com/documentation/AppleApplications/Reference/SafariHTMLR ef/Articles/HTMLExtensions.html#//appleref/doc/uid/TP40002066-DontLinkElementID13

Similar Messages

  • Problem resizing Viewport with WebDeveloper in WinXP and Vista

    I'm having a problem resizing the Viewport with WebDeveloper running in FF10 & FF11 on my WinXP and Vista machines. Quite simply, I'm trying to resize the Viewport to 320x420pixels (to represent an iPhone) but can't get it to go below 510px.
    There's no problem in FF1 on Win7. I have contacted Chris Pederick, the developer of WebDeveloper, and he says his code is tha same in all cases, and pretty basic JS. So possibly the fault lies in the browser. I've not noticed this problem in earlier versions of FF (i.e around 3.5)

    Try to hide all toolbars or open a second window and hide them there to see if that allows to make the window smaller.

  • Has anyone encountered drastic shorter battery life both on iphone 5 and ipad since updating to iOS 6.1.2? How can this problem be solved?

    Dear all,
    I am new to this community even though I have been a Apple user for years, so please forgive me if this question is not in the right section.
    Has anyone encountered drastic shorter battery life both on iphone 5 and ipad since updating to iOS 6.1.2? I've always been happy with these two products until the update - now the battery life is considerably shorter which is extremely frustrating.
    How can this problem be solved? Is there any way to go back to the previous version?
    Thanks for your help.

    If you update using iTunes the phone is first wiped clean, then the new OS is installed, and finally the backup is restored. After this finishes if you sync your music should be restored. Music is not in the backup, because it is already on your computer and duplicating it would use up a lot of hard disk space.
    An OTA update just patches what has changed; it does not disturb content.

  • My iphone 4S has problem in making and receiving the calls. While making the call , call fails and netwrok disappears. Like wise no voice is heard for incoming calls. This happened after return from the overseas travel.

    My iphone 4S has problem in making and receiving the calls. While making the call , call fails and netwrok disappears. Like wise no voice is heard for incoming calls. This happened after return from the overseas travel.

    Hello SamSax
    Check out the assist page below for troubleshooting call connectivity.
    Calls and connection issues
    http://www.apple.com/support/iphone/assistant/calls/
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • I have an iphone 5s and when I make a playlist on itunes for music videos and sync my iphone the playlist does not show up. What can I do to fix the problem?

    I have an iphone 5s and when I make a playlist on itunes for music videos and sync my iphone the playlist does not show up. What can I do to fix the problem?

    Version 11.1.5.5 of iTunes was just released today. If you update to that, does that help with the recognition troubles?
    http://www.apple.com/itunes/download/

  • I recently had to swap out my iphone 4s and I am having problems restoring photos and videos from icloud.  I get a message on my phone that says " the URL you are requesting is not found on this server".  Pics and videos have been deleted too.

    I recently had to swap out my iphone 4s and I am having problems restoring photos and videos from icloud.  When I restored my phone from icloud, half of my pics and videos have been deleted, the pics that were restored on my phone are very blurry, and the videos won't play.  I get a message on my phone that says " the URL you are requesting is not found on this server".  I have erased and reset my phone twice, but every time I do it, more pics and videos are deleted.  I have backed up to icloud and iphoto, however, some of the pics are no longer on iphoto either.  Is there someway to get the videos to play on my phone again?  Make the photos not as blurry as they are now and to restore the pics and videos that have been lost?  I really would love to have them back, this phone is supposed to be the best and right now it doesn't seem to be.  Please help if you can.

    I too have noticed that once i restored from iCloud. Pictures blurry and videos wont play!
    Need help too!!

  • Hi. I am just about to move from the UK to Kuwait. Will I have any problems using my iPhone 4 and able to join a local carrier using this device please?

    Hi. I am just about to move from the UK to Kuwait. Will I have any problems using my iPhone 4 and able to join a local carrier using this device please?

    If your phone is locked to a particular carrier, you must contact them to request they unlock it. Once they've taken care of that and you've followed the instructions to complete the unlock process, you will be able to use the phone elsewhere.
    ~Lyssa

  • HT1871 Hello i have one IPhone 4S and I use 3G net in my mobile sometime I have problem with temperature in my phone at the SIM card or battery how can I fix this problem. By update or version of 6.1.3

    Hello i have one IPhone 4S and I use 3G net in my mobile sometime I have problem with temperature in my phone at the SIM card or battery how can I fix this problem. By update or version of 6.1.3

    Could it be because the SIM card got damaged while I cut it to fit the IPhone?
    Very likely. Hard to believe the carrier in Mexico doesn't have a micro-SIM card available.
    Or somehow the Chinese carrier found out and locked it?
    No, which is not possible.
    What can I do? Get a new SIM and see if it works again?
    Get a micro-SIM from the carrier in Mexico that you don't have to manually cut down. If that carrier doesn't provide one, switch to another carrier that is not so low-budget.

  • I have an iPhone 4S and never had a problem with syncing it. But suddenly, when I connected my phone to my mac, it says that its in recovery mode, and I need to restore it in order to sync. I've updated both my phone and my itunes, and it didnt work.Help?

    I have an iPhone 4S and never had a problem with syncing it. But suddenly, when I connected my phone to my mac, it says that its in recovery mode, and I need to restore it in order to sync. I've updated both my phone and my itunes, and it didnt work.Help?

    fighter19lisa wrote:
    that only makes it say its synced, when its not.
    No, it does not.  It transfers purchases from the iDevice to the computer.  The computer must be authorized for the Apple ID that the content was acquired with.
    fighter19lisa wrote:
    my playlists wont show up on the phone.
    Are they selected to sync?  Is Manually Manage content on the device selected?
    fighter19lisa wrote:
    i had to change my password for my aol account again and i still cannot get my email on my phone to even work
    What does that have to do with syncing content to the device?  FYI, nothing.

  • HT201304 Hi! My My mom bought me an iPhone 5 and I have a problem with my facetime I cant find it! Cant find it in settings and restrictions. She bought this in Bahrain both my iPhone and she ipad mini and she has facetime on her. What should I do?

    Hi! My My mom bought me an iPhone 5 and I have a problem with my facetime. I cant find it! Cant find it in settings and restrictions. I remember when she gave me this I see facetime in settings and after a couple of days its gone! She bought this in Bahrain both my iPhone and her iPad Mini. And I'm just wondering why she has facetime and why mine is missing? Please help! My iMessage is perfectly working. I lived in the Philippines

    Are you trying to use the phone in Bahrain with a supported carrier there? I suspect not. If you try to use this phone outside of Bahrain, you won't have FaceTime. This is done to prevent folks from simply crossing the border to purchase iPhones in Bahrain...FaceTime is banned in Saudi Arabia & the UAE. Sorry, but you'll only have FaceTime on that phone while using it in Bahrain on a supported carrier's network there.

  • Hi, I have an iphone 4 with my itunes library on a Windows XP computer.  My spouse who has now passed away had an itouch and an Itunes Library on an Imac...so here is the problem I got a new iphone 6 and wanted to update my itunes library from my win

    Hi, I have an iphone 4 with my itunes library on a Windows XP computer. My spouse (who has now passed away) had an itouch with an itunes library on an IMac. here is the problem, I bought an new iphone 6 and wanted to sync with my windows xp library and of course my itunes version is out of date and I need to update it...well I try and update the version and it will not update the Itunes library and when I researched it I would have to upgrade from XP to Windows 7...r they kidding me...first of all my computer is old and a pain in the *** but I have my itunes library on it.  Sp to get my phone working I sync'd it on the IMac and my spouses Itunes library has been sync'd to my iphone and I don't know how to get my library on it...After thinking about it I want to combine the libraries after all there are some purchases on each one.
    I have done some research and you have to buy a 3rd party piece of software...this is not the way I want to go...I do not think i should have to buy one and also when I do a goole search there are a ton of them out there and I am sorry i do not trust the comments as some of them do identify that they will get a kick back.
    Can someone help, i should be able to export my itunes library from my iphone 4 to the itunes library by appending/importing it...it is not rocked science on what I want to do and I cannot find out any process...
    Can someone help ?

    Create a new user account on the computer that he can log in to.

  • Various problems when trying to use both my iPhone 4 and iPhone 5 at the same time? HELP!

    I am experiencing a wide range of problems with both of my iPhones. They are both a 4 and a 5. I will list the problems I am having.
    Using both phones:
    A few weeks ago I recieved a new phone, the iPhone 5 as my contract was renewed. I backed-up my old phone, the iPhone 4 to my computer and restored it onto my 5. But when using my 5, I discovered it has 'no service' (but will use wifi), it won't send IMs OR texts and Apple constantly keeps asking me for my Apple ID which i recently changed but still uses the old email, and won't accept any passwords.
    The 5 used to send IMs and texts but they would be sent to my friends through my email address, so I googled this and went to messages>send and recieve, and the only thing i can select is my email, not my number. I am using the 4 as well, purely so I can send texts and IMs through my name, not my email. The 4 also has signal and wifi, whereas the 5 only has wifi. I am wondering if the 5 has no signal and won't send IMs & texts because I am still using another phone? Surely they both cannot work together, so I was thinking I could reset my iPhone 4, and then see if the iPhone 5 will work, once the second phone isn't used anymore. If that doesn't work, I thought I could reset my 4, back-up my 5 and then restore again. I think that will work, but I have no idea.
    I have absolutely had it with trying to figure it out, I have used google but nothing seems to work. I am really hoping someone can tell me what to do with all my phone problems, because they are absolutely driving me mad!!!!!!!!!!!!!!!!!!! 
    I need to use the 5, it is costing me an extra £60 a month to use and I feel as though that money is being wasted as I can't text, IM or call people. Should i just get rid of the 4 and see what happens? I read online that to stop iMessages coming through as your email, you should turn it off and use regular texts. BUT I DO NOT WANT TO DO THIS. I send way too many texts, and it would cost a fortune. I also can't send photo messages on texts, because they cost a bomb to send through. I want to be able to use both texts and iMessages - using my name, not my email. 
    To add on to that huge essay I have written, on both phones Apple CONSTANTLY asks me for my Apple ID which I recently changed. I changed the email and the password, and it is coming up with the wrong email, and whatever password I put in, it still says it is wrong. It doesn't make sense, because yesterday I purchased some music from iTunes and when asked for my Apple ID, it used the right email and accepted the correct password. ...??? yet it still keeps getting it wrong, even though it worked in iTunes. ??!?
    Okay so I just reset my iPhone 4, and nothing seems to have changed...I thought if I reset it, it would be completely wiped, like a brand new iPhone 4, but it's not....THIS IS SO IRRITATING! Can someone please help me! I GREATLY appreciate any answers, hopefully someone on the internet can fix my problem! thank you for taking the time to read this essay, I am very thankful. PS. Both phones are up to date.

    You said, "the 4 also has signal and wifi whereas the 5 has only wifi". By "signal", I'm assuing that you mean cellular signal. If so, that means your iPhone 4 is still active on your cellular number and your iPhone 5 is not. Contact your carrier to sort out which phone is active on your account.

  • I have a IPhone 5 and Iphone 5s. Both are set up with the same account ID and running IOS 8.0.2. When the phones are connected to the same Wifi at home, both phones will ring when someone call in to one of the phone.  Anyway to solve this problem?

    I have a IPhone 5 and Iphone 5s, each phone is activited with a different service provider. Both are set up with the same account ID and running IOS 8.0.2. When the phones are connected to the same Wifi at home, both phones will ring when someone call in to one of the phone.  Hence you do not know exactly which line the caller called.  If you answered using the wrong phone, then anyone calling the other number will not get through.  Anyway to solve this problem?

    Hey David Koh TP,
    Thanks for the question. It sounds like your devices are set up to use continuity together. Specifically, it sounds like you are signed into the same Apple ID in FaceTime, and have iPhone Cellular Calls enabled. To resolve your issue, simply disable this setting:
    Connect your iPhone, iPad, and iPod touch using Continuity
    http://support.apple.com/kb/HT6337
    Turn off iPhone cellular calls
    To turn off iPhone Cellular Calls on a device, go to Settings > FaceTime and turn off iPhone Cellular Calls.
    Thanks,
    Matt M.

  • I have an Iphone 4s and i can't make a connection to my mac and other devices via bluetooth! Why is this a problem and how can i repair it?

    I have an Iphone 4s and i can't make a connection to my mac and other devices via bluetooth! Why is this a problem and how can i repair it?

    "I have an Iphone 4s and i can't make a connection to my mac and other devices via bluetooth! ":
    That is correct.
    "Why is this a problem and how can i repair it?"
    Becasue this has never been a feature of iphone/ipod/ipad.  There is nothing to repair.

  • I'm having a billing issue with my apple id. I got my first iPhone today and I've signe din etc however before i can download any apps etc i need to resolve an old payment apparently. The problem is i cant enter my new card details because no longer in US

    I'm having a billing issue with my apple id. I got my first iPhone today and I've signe din etc however before i can download any apps etc i need to resolve an old payment apparently. The problem is i cant enter my new card details because the issue is registered to when i was in America and i require to pay the funds from an American source. Any ideas how i can resolve this? It wont accept my new card detail as im back in the UK. I think i have posted this in the wrong area but anyone got any ideas?
    I have managed to change the rest of my accoutn being registered to the UK i think except this

    Hi..
    You can email Apple for help but the link is for the iTunes store not the Mac App Store. You've inadvertently poasted in the Using Mac App Store forum but that's ok. Billing issues are the same for the iTunes Store.
    Click here > Apple - Support - iTunes Store - Contact Us
    It wont accept my new card detail as im back in the UK
    Your credit or debit card credentials must be associated with the same country where you reside.
    "Although you can browse the iTunes Store in any country without being signed in, you can only purchase content from the iTunes Store for your own country. This is enforced via the billing address associated with your credit card or other payment method that you use with the iTunes Store, rather than your actual geographic location."
    From here >  The Complete Guide to Using the iTunes Store | iLounge Article

Maybe you are looking for

  • Justifying Mac vs PC for business

    I have an iMac at home but my employer is strictly PC-based. I'm the manager of communications and marketing, and we use a creative agency to develop our materials. I'm due for a laptop upgrade and some in our IT group support my desire to switch to

  • How do i get my audio book i purchased

    how do i get my audio book i purchased on my ipad from itunes

  • You do not have access to any End User Layer tables

    Hello Guru's! I'm having an issue with connecting/using EULs on Disco 10g - I have already installed 10g Admin and configured 2 EULs and also imported the sample data - they are all owned by DISCO user - When I connect to http://discoserver:7778/disc

  • Outage in your area?

    I have been without broadband since Thursday morning and have been told by BT that there is an outage in my area and many others (my area is 01531) and it will be fixed within 24-48 hours, it is now 96 hours plus and still no sign of it being fixed.

  • Cross Forest Support - Same Boundaries?

    We're planning move our existing AD to a new domain with a different name. To support clients in the new domain, would it be easier to just setup a new SCCM 2012 R2 instance and then let it manage systems in the new domain? We currently have our boun