I'm making a little application to post photos to my photo blog. For the sake of learning I thought I'd make a little UI to go with it, but I've run into a problem.
I have made a sheet that has an ImageView at the top, with a button underneath to choose a photo from the camera roll. Below that, there are 3 TextFields for title and other stuff. I was quite proud of myself for creating a delegate class that shifts the whole View up when the text fields receive focus and then back down when they lose it! (I commented this all out to see if this was a problem but it still happens).
The ImageView, by chance, ends up being about as tall as the space left when the keyboard is visible, and here's where I hit a problem.
If I start the app, then press one of the text fields, the keyboard pops up. If I then press the 'choose image' button, I see the keyboard slide away as the photo picker slides in, but when I choose a photo, the ImageView updates and the keyboard slides back up but none of the text fields appear to be selected. Because the ImageView is the same size as the space above the keyboard, I can't select any of the other controls and can't dismiss the keyboard.
Is there a way to programmatically dismiss the keyboard so I could force it to go away when the 'pick photo' button is pressed?