Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialShrikar Archak
5,936 PointsInput accessory view doesn't work in ios 8 . Any hints on how to do that? The accessory view covers the whole screen
I followed the exact same method the input accessory view work in ios7 but for ios 8 it doesn't work and covers the whole screen
3 Answers
Carl Ehrnrooth
3,198 PointsI was having a similar problem with the accessory view taking up the entire screen. My solution was to first layout the buttons with Autolayout inside the View (equal widths, set trailing and leading edges, and a few more constraints), and then after setting the accessory view in code per the video I set the frame in code using:
[self.textField.inputAccessoryView setFrame:CGRectMake(0, 0, self.view.bounds.size.width, 30)];
This way the height is always 30 and the width is the width of the screen in any orientation.
Originally I had set my View background as grey and was having some issues with the alpha values of the buttons. This cleared up by setting the View background back to transparent.
Also, when dismissing the view there was a little bit of lag between the keyboard and accessory view going away. I solved this by adding this to the viewWillDisappear method.
-(void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[self.textView resignFirstResponder];
}
Jose Bamhaoud
3,568 PointsIn my case the mood selection appears but no keyboard.
PD: I found this on the web:
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.
Found in : http://stackoverflow.com/questions/25834851/inputaccessoryview-does-not-show-on-ios-8-simulator
Written by : nyekimov
Madhav Sharma
4,081 PointsDo what he says! Thanks!
Shrikar Archak
5,936 PointsI did the same thing which is mentioned in the video but no luck.. Just to check did disable Autolayouts? I have it enabled it.. Thats the only difference I see.
Erion Vlada
13,496 PointsErion Vlada
13,496 PointsI too am working on iOS 8 and it worked perfectly for me. Make sure you have draged all three buttons into the View which is 320 * 30. Once all three buttons are in there.
In the document outline/ the bar to the left of the story board, you need to drag the View with the buttons in it on the top layer of Entry View Controller Scene. You will know you have dragged it outside correctly when you can no longer see the View with the buttons in your storyboard.
Hope that helps.