iPhone - Have the keyboard slide into view from the right like when editing a note in Contacts

前端 未结 5 1787
轻奢々
轻奢々 2020-12-30 01:33

I\'m looking for a way to slide the keyboard into view from the right, like what happens in the Contacts application when you edit a note.

My problem is that when I

5条回答
  •  抹茶落季
    2020-12-30 02:33

    You could try sending the becomeFirstResponder message to the new view controller before you push it onto the stack. For example:

    -(void)functionWhereYouPushTheNewViewController {
      yourNewViewController *newVC = [[yourNewViewController alloc] init];
      [newVC.yourTextView becomeFirstResponder];
      [self.navigationController pushViewController:newVC animated:YES];
    }
    

    I have found that changing animations on things like they keyboard is pretty tough though, and if you read the Human Interface Guidelines Apple makes it pretty clear that they want certain things to act in certain ways, all the time. There are ways to change the behaviors of certain animations but they often involve undocumented API calls and are grounds for rejection from the app store. It would be a violation of HIG to have pushed views slide up from the bottom, for example.

    Hope this helps.

提交回复
热议问题