Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9137619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:07:32+00:00 2026-06-17T09:07:32+00:00

We’re building an iPhone app that’s basically a wrapper around the mobile version of

  • 0

We’re building an iPhone app that’s basically a wrapper around the mobile version of our website. Upon selecting the textarea in the chat page, the webview should be resized to fit the area above the keyboard.

However, when changing the frame of the uiwebview in keyboardwillshow, the focus of the textarea gets cancelled. When tapping the textarea again when the keyboard is showing, it does get focussed.

I’ve also tried changing the bounds instead of the frame. The textarea did get focus then, but somehow it anchored to the bottom of the original bounds instead of to the top. Does anyone have experience with this problem?

EDIT: I’ve fixed the first problem now by changing the webview size on keyboardDidShow instead of keyboardWillShow. However, it seems that the site does not properly update on the resize, and the header of the site does not get in the view. I edited the code below to how it currently is.

- (void)updateBounds {
    CGRect appFrame = [UIScreen mainScreen].applicationFrame, newFrame;

    if (!kbFrame.size.width) {
        // no keyboard
        newFrame = appFrame;

    } else if (kbFrame.size.width == appFrame.size.width) {
        // horizontal keyboard (relative to straight oriented device)
        newFrame = CGRectMake(0, 0, appFrame.size.width, appFrame.size.height - kbFrame.size.height);
    }
    else {
        newFrame = CGRectMake(0, 0, appFrame.size.width - kbFrame.size.width, appFrame.size.height);
    }

    webview.frame = newFrame;

}

- (void)keyboardDidShow:(NSNotification *)note {
    NSLog(@"keyboardShow");

    [[note.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] getValue: &kbFrame];

    [self updateBounds];
}

- (void)keyboardWillHide:(NSNotification *)note {
    NSLog(@"keyboardHide");

    kbFrame.size.width = 0;
    [self updateBounds];

    webview.frame = [UIScreen mainScreen].applicationFrame;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:07:33+00:00Added an answer on June 17, 2026 at 9:07 am

    Eventually we ended up adding some logic to the website, and leaving the UIWebView alone. What we tried to achieve is now done with javascript to move some elements around on the webpage. It is sub-optimal, but it does the job without breaking everything.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Let's say I'm outputting a post title and in our database, it's Hello Y’all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.