heMac
heMac

Reputation: 1539

InputAccessoryView does not show on iOS 8 simulator

I have iOS application since iOS 5, it includes a custom UITextView which use its own inputView and inputAccessoryView. It works with iOS 7 simulator, when it becomeFirstResponse, both inputView and inputAccessoryView show, but with iOS 8 simulator, only associated inputView shows, the inputAccessoryView does not show.

I am using Xcode 6 GM seed

HeInput_TextView.m

- (void)awakeFromNib
{

   self.text = @"";

   heKeyboard4x5 = [[HeKeyboard_ViewController alloc] init]; 
   inputAccessoryVC = [[InputAccessory_ViewController alloc] init]; 

   self.inputView = heKeyboard4x5.view;
   self.inputAccessoryView = inputAccessoryVC.view;
}

Is it a bug in iOS 8 simulator or a change for iOS 8?

Edit:

I found more information about this problem.

This problem happens in Page-Based application, if an UITextView in a page of UIPageViewController, then the UITextView.inputAccessoryView doesn't show at iOS 8 simulator, but shows in iOS 7.1 simulator.

I creates two projects: 'Single-View Based application' and 'Page-Based application', and confirmed the problem happens as described above.

Upvotes: 2

Views: 5063

Answers (4)

Friggles
Friggles

Reputation: 634

I've found view accessories in iOS8 don't use the view's frame to offset their height above your InputView (or even the default software keyboard).

You might need to make sure your inputAccessoryView implements

-(CGSize)intrinsicContentSize

eg:

@implementation InputAccessory_View
// .. your code ...
-(CGSize)intrinsicContentSize{
    return self.frame.size;
}
@end

Upvotes: 1

Paul Bruneau
Paul Bruneau

Reputation: 1076

My apologies, I misread the item. I've been driven batty by iOS8's keyboard issues.

Upvotes: 0

Brett
Brett

Reputation: 1837

It's an iOS8 bug.

You can reproduce it on the simulator in Apple's Contacts App.

Add a new contact and scroll down to "add a date".

Same problem. A colleague has raised an apple rdar.

Upvotes: 3

Nik Yekimov
Nik Yekimov

Reputation: 2697

it is new behaviour of simulators in xcode 6. to see your custom accessory view or even default one try to uncheck hardware -> simulator -> connect harware keyboard.

Upvotes: 3

Related Questions