Strange UICollectionView behaviour when VoiceOver is enabled - ios

I have a UICollectionView that each of it's cells is a UIWebView, where the last cell contains a link that pushes another UIViewController on screen. This UIViewController has a back button that pops the UIViewController off screen and should display the last cell on the UICollectionView again.
This flow works fine when VoiceOver is turned off, however when VoiceOver is turned on, when the user taps on the back button - the collection view automatically scrolls back to the first cell.
I've googled this to death, but nothing seems to work.
Any suggestions?

Related

Odd collection view scrolling behaviour with UITextField in UICollectionViewCell

I have a UICollectionView with some UICollectionViewCells that contain UITextFields. When a UITextField is selected for editing, the keyboard shows and the UICollectionView moves up accordigly to make the active UITextField visible. I am relying on default behaviour with this and the UITextField is actually appropriately positioned when UIKeyboardDidShowNotification is launched. However, right after that, the UICollectionView will scroll automatically back to the top, and the UITextField will move out of view (behind keyboard).
What could be causing this and how could I debug this behaviour? Please note, that any custom code for UIKeyboardDidShowNotification like scrollRectToVisible or Apple's sample code will not help, as the scrolling off viewable areas happens at a later stage overriding that code. I am just unable to pinpoint the cause of this.
EDITED to add:
An animation to show how the view behaves with a hard keyboard (iPad Pro) when clicking Next to cycles fields. This works fine.
An animation to show how the view behaves with a soft keyboard when clicking Next to cycles fields. Here the keyboard avoiding does not work.

Adding Animating button to each image in UICollectionviewcell just like iPhone Photo App

I'm in the process of creating iPhone photo App like application.In iPhone Photo App on selecting a image -> Tapping share button -> Rotate the device to landscape, we get a selection button at the bottom of all the image items. The selection button frame gets animated when the UICollectionviewCell is scrolled I would like to achieve the same behavior in my app.Any pointers would be really helpful.
Use the scroll view delegate to detect when the user is scrolling. You get a scrollViewDidScroll: event every instant the user scrolls at all. This allows you to figure out whether the button for one of the cells is being moved off the visible area of the screen. If it is, move it the other way to compensate and thus keep it on the screen.
A really useful trick is, once the cell is moving off the screen, to rejigger the button's constraints so that it is constrained to the window (or the root view). This means that it stays still while the scroll view scrolls, even though it is a subview of the cell!
Of course you also have to detect when we have scrolled so far that the button has reached the other edge of the cell, and "let go" of it - allow it to scroll with the cell once again.

UITableView awkward touch issue in landscape

I've a strange issue with UITableView, though I've many tableviews but the problem is with a particular tableview (in a viewcontroller that's the first viewcontroller of uitabbarcontroller).
In the portrait mode everything works fine. But in landscape mode, the right half of the tableview doesn't recognise any touches, and also the scrollview doesn't respond. The tableview and the subview of the cell takes there position as I needed, but the responsiveness of the touch-events is limited to the width that corresponds to that of portrait mode. beyond that the touches are not getting recognised.
And it's not all. The strange thing is that when I open another tab and come back to this starting tab, all works fine. Scrollview starts responding even when touched in the right half, the button in the extreme right of the cell works fine and right half of the textview in the middle of the cell also responds properly.
Though all of three tabs of the uitabbarcontroller have tableviews but the starting, the main, tab shows this awkward behaviour.
The behaviour is same for iPhone and iPad.
Kindly respond quickly, if anyone knows the answer to this problem.

UITableView won't stay scrolled up in iPad popover

I use a UITableView inside a popover in my iPad app to ask for user input, just like the Contacts app on the iPhone. It has 3 sections, and each section has multiple rows. Clicking on a row brings up a keyboard. When clicking on the bottom row of the bottom section, the keyboard hides the row, and when I scroll the table up, it bounces back down instead of staying scrolled up. On the iPhone Contacts app, the table stays scrolled up, and this is the behavior I want. Any pointers?
It's probably because you are not resizing your table view when the keyboard appears. You should take a look here http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html.
The section "Moving Content That Is Located Under the Keyboard" is what you are looking for.
For your information, a UITableViewController automatically resizes its table view when there is in-line editing of text fields. If it's possible for you, you can just change your class to a UITableViewController and you won't have to worry about resizing.

iOS: Disable UITableView animation when keyboard shows up

Everyone wants to move the UITableView when the keyboard pops up, but I'm looking for a way to disable the automatic animation to the cursor when the keyboard pops up. I'm experiencing an odd jerking / jolting / erratic scrolling behavior when the keyboard pops up and causes the UITableView to scroll to the cursor (to avoid blocking it).
Each of my UITableView cells has a UITextView in it. I don't commit any other animations when the keyboard pops up.
At this point, I would like to disable the animation completely and manually scroll to a desired CGPoint.
Thank you!
The automatic scrolling code resides in tableViewController, so auto-scrolling can't be disabled. Instead of subclassing from UITableViewController you can subclass from UIViewController and use a tableView inside it.
If you are willing to use UITableViewController itself, you can override viewWillAppear and don't call [super viewWillAppear].

Resources