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 8008137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:02:52+00:00 2026-06-04T18:02:52+00:00

We’re using Phonegap to develop our mobile app, and we borrowed code from here

  • 0

We’re using Phonegap to develop our mobile app, and we borrowed code from here to remove the black next/prev/done bar from the keyboard:

https://stackoverflow.com/a/9276023/35364

What that code does is it finds the black bar, as a UIView object, and calls ‘removeFromSuperview’ on it.

We’re not familiar with the iOS SDK/API. So while we can look at the code and get an idea of what it’s doing, we can’t tell if it’s doing it properly, or how to improve it.

The specific problem we’re running into:

We have a text field for writing a message, and we’re manually controlling the placement of this field to be exactly above the keyboard, similar to the native sms app. In other words, we’re putting it where the black bar was supposed to be.

When we focus/type in the message field, the system pushes the view up. It seems like this is a mechanism to make sure the text field is not invisible when the user types in it.

This is happening even though the text field is visible.

I noticed that by putting the input field right above where the black bar would normally be (as oppose to behind it), the view doesn’t scroll.

So it seems the system somehow thinks the black bar is still there!

(To double check: when the black bar is not removed, and we put the text field right above it, we can focus and type in it, and the view would not scroll).

So the question is:

Why does the “system” push the content up when editing a text-field that’s place right “behind” where the black bar is supposed to be? Is it because the black bar is not completely removed yet? Do we need to do something to “completely” remove the black bar? Do we need to force iOS to recalculate the size of the keyboard? or what exactly?

Is this mechanism (pushing up the view) implemented by iOS’s UIWebView, or by Phonegap?

Is there any phonegap app that has solved this problem?

  • 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-04T18:02:55+00:00Added an answer on June 4, 2026 at 6:02 pm

    replace

    [subviewWhichIsPossibleFormView removeFromSuperview];
    

    with

    UIScrollView *webScroll = [webView.subviews lastObject];
    CGRect newFrame = webScroll.frame;
    
    float accesssoryHeight = subviewWhichIsPossibleFormView.frame.size.height;
    newFrame.size.height += accesssoryHeight;
    
    [subviewWhichIsPossibleFormView removeFromSuperview];
    [webScroll setFrame:newFrame];
    

    it resize the content scroll view for the amount of missing accessory space. It is as far using “private API” as the other code. In detail it isn’t using private API directly but if Apple decide to change how a view appears (in this case Keyboard and WebView) then it will crash.
    For example if they rename UIWebFormAccessory, your code will not work anymore.

    EDIT:
    on iOS 5.0+ you can call webView.scrollView directly. So you can split the code to have a pre iOS 5 fallback:

    UIScrollView *webScroll;
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 5.0) {
        webScroll = webView.scrollView;
    } else {
        webScroll = [webView.subviews lastObject]; // iOS 2.x (?) - 4.x
        // make sure this code runs appropriate on older SDKs
    }
    
    • 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
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.