Space between keyboard and Tab Bar...

Discussion in 'iOS Programming' started by furrybaer, Mar 26, 2013.

  1. furrybaer macrumors newbie

    Joined:
    Sep 8, 2011
    #1
    In my iPad app, I have a Tab Bar Controller with three tabs. The first Tab has a Table View and a Search Bar at the top. There is an "Add" button in the Navigation Bar. When I click the "Add" button, it navigates to a new View Controller that has Labels/textfields/etc. If I set the first textfield to "BecomeFirstResponder", the keyboard pops up, but there is space between the BOTTOM of the Keyboard and the Tabs. I didn't set ANY special spacing. I event started a NEW Project (Tab Bar Project) and made modest additions to try to reproduce the problem. The space is there in the new test project as well. See attached image. Has anybody else seen this? Not sure what I am doing wrong. I am using Xcode 4.6 and IOS 6.1. Thanks.
     

    Attached Files:

  2. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #2
    Dunno.

    I just created a nib-based iPad tab bar app, added a UITextField to the second tab's view controller, and ran it in the simulator. When I click in the text field the keyboard appears as expected, but it is pinned to the bottom of the screen.

    At first I had auto layout turned on (or more accurately, forgot to turn it off). It worked fine. Then I turned autolayout off and still the keyboard is at the bottom of the screen.

    I also tried it on my iPad 2 (running iOS 6.1.3) and again the keyboard is placed correctly at the bottom of the screen.

    I'm using Xcode 4.6.1.

    I think you're going to need to provide a more complete explanation of what you're doing.

    Or, do the dirt-simple test I just described. Create a tabbed app. Add a text field to one of the tabs, and don't do ANYTHING ELSE. Then see what happens.
     
  3. furrybaer thread starter macrumors newbie

    Joined:
    Sep 8, 2011
    #3
    space between keyboard and bottom of screen...

    Duncan, thanks for responding. I upgraded to xcode 4.6.1 and created a new project (Single View) and all I did was add a UITextfield and on viewdidload, [self.txtVineyard becomeFirstResponder]. The space was still at the bottom of the screen for the iPad simulator. Looks fine for the iPhone simulator. Doesn't matter if it is Retina Display or not...Maybe I need to uninstall xcode and reinstall...

    Thanks again.
     
  4. Duncan C, Apr 5, 2013
    Last edited by a moderator: Apr 5, 2013

    Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #4

    I doubt it. That does not sound like a corrupted Xcode problem
     
  5. Duncan C, Apr 5, 2013
    Last edited: Apr 5, 2013

    Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #5
    Are you using autolayout or struts and springs?

    I would suggest putting code that triggers the keyboard in viewWillAppear instead of viewDidLoad.

    Also, do you have code to slide your view up to make room for the keyboard? I just did some testing and found that when I used my normal code to slide the view controller's view up to make room for the keyboard, it slid the view too far because my calculations were based on the view controller's view being all the way at the bottom of the screen.
     

Share This Page