UIDatePicker not displaying correctly - ios

Basically this issue started when I updated my app to run with iOS 9. Without making any change in the code now a white square appears over the picker view, but it works normally.
Note that the user can hide and show the picker views and the cells they're in. If you need more info leave a comment.
UPDATE: Here is the full screenshot of the Table View:
UPDATE 2: The following shows when I preview (press bar space button) the _pickerView property in the variables debugger. This makes me think the strange view is inside the UIDatePickerView and that it's a bug.
UPDATE 3: Extensive Research
So I finally did more research using the view inspector and the debugger and I got to some conclusion, although I still don't know how to solve it.
Using the view hierarchy debugger I found out the the white strange view it's a UIPickerTableView inside the UIDatePicker.
Here we can see the subject selected in blue and it's name at the top of the screen. I also wrote the whole hierarchy from the picker view to the subject so you can see it.
Next step was inspecting my datePicker var with the debugger to see if I could get to that UIPickerTableView causing problems. Inside it I could find 3 views, each one corresponding to each component (day, month, year). Let me show you the quick look of each one of these:
Click the pics to enlarge
In the first and the third one (day and year) we can see what look like some misplaced views next to the actual labels with the numbers. These properties, as you can see in the screenshot, are UIPickerColumnViews. I didn't go any further but you can imagine that if we inspect that property we would find the subject as a UIPickerTableView.
After all that I got to the conclusion that the misplacement of those views is what might be causing the issue. And that's all for today.
FINAL UPDATE
So some days after filing the bug report Apple answered and marked it as a duplicate. So I guess we just have to wait they fix it. You can check the radar at rdar://22566989

Apple Developer Relations marked my bug report as a duplicate, so I guess it is an SDK bug that they'll have to solve. It is still open by the time of this post (12 Oct).
Workaround
In the viewDidLoad() method change a property of the date picker, for example the mode. You don't have to leave it changed, you can set it to anything and then change it back to what you actually want.

Here's the hack that worked for me: If you change the UITableView separator style to None the problem goes away. Seems like a bug on Apple's end, like the numerous problems we are finding in iOS 9.9

I had the same issue, i discover that happened because my UIDatePicker was separate from view of my view controller. I added this view as a sub view in code. To solve this problem, i add the UIDatePicker in viewDidLoad method, this is helped me

Related

iOS accessibility doesn't recognize anything on the screen

I'm trying to make my app accessible (use voice-over properly).
It works just fine in the first screen (login), but after the login no element gets the accessibility focus. It seems to be stuck.
Accessibility inspector's audit gives me this issue for all of the "should-be-accessible" elements in the screen:
This element appears to display text that should be represented using the accessibility API
When pressing the question mark I get:
Determine if any part of the content should be exposed as separate accessibility children
Does anybody have an idea? Did you get this warning?
P.S.
Apologize in advance, but I can't share my code because of security reasons.
Solved my problem.
Apparently, i've added another view after the login and then animated it off screen, but did not remove from superview.
It caused the app to lose accessibility focus (the focus was on the status bar only).
After removing the view, my app got the accessibility focus again.
My lesson from this problem - remove unnecessary views!
P.S
It's legacy code - wasn't written by me :)
You can follow three things :
You can all the view hierarchy and check whether accessibilityElements are properly set or not.
Unnecessary views isAccessibilityElement property should be set as false.
remove Unnecessary views.

Text Field doesn't active for Static Cell in Table View Controller?

I have Single View App for IOS Xcode 6.4. Example Add Player screen, I tried it by myself, but Text Field doesn't active to click and typing at my application simulator (UITableViewController Static Cell) I have compared my project with example final project, everything looks good similar. How to fix this problem?
First you try with cmd+k that will open the simulator's keyboard. If that is not working then try with cmd+shit+k that may hide your keyboard but you can able to type on the text filed. If that also not work then you may accidentally off the user interaction for text field. Or may be some other view covering your text field which is transparent, so you are not able to see it. I hope that will save your problem, otherwise please provide your code sample.
There is a bug in the segue transition. Set the transition to None and it should work. I had the problem with a Curl transition.

UITextView as InputAccessoryView doesn't render text until after animation

When showing the detail viewcontroller for the first time, the inputAccessoryView will render the text immediately, but when you go back and try it again, the text doesn't get rendered untill the animation completes.
See demo project here:
https://github.com/SabatinoMasala/accessoryview-demo/
If anyone has a resolution, explanation or workaround, I'd be glad to hear it!
I've been experiencing the same issue and I found a simpler workaround. It seems that this bug is related to the fact that inputAccessoryView animation is using a snapshot of the view. Forcing the snapshot appears to resolve the issue:
let _ = accessoryView.snapshotViewAfterScreenUpdates(true)
I tried messing with your project and, unfortunately, I saw the same behavior that you did. This may be a bug in UIKit.
I found a workaround for this issue, take a look at the HackFix branch of the project here: https://github.com/SabatinoMasala/accessoryview-demo/tree/HackFix
We achieve this workaround by adding a dummy textfield to the view hierarchy, which we then remove on ViewDidAppear. On ViewDidAppear we also show the InputAccessoryView, which was hidden beforehand.

UIPageViewController bug with UITextField and keyboard showing

So I'm trying to find a workaround for this bizarre bug:
http://www.screencast.com/t/UqvVn8ccodEV
Basically I have a UIPageViewController with sub view controllers (obviously). Once I add a text field, it does this weird thing where if you scroll it and then click a text field, it randomly moves to another page. None of the delegates get called, and the keyboard moves up and down again.
Seems like the same thing as here: clicking/typing on UITextField increments UIPageViewController instead of displaying keyboard
Also seems to be recorded here: http://openradar.appspot.com/13315308
Can't figure out what the hell this would be, or a way around it.
Edit
Here is a skeleton version (pulled from the linked question):
https://www.dropbox.com/s/6l5efem3wque7li/pageScroll.zip?v=1mci
Scroll one page, then hit the textfield. Only happens the first time around.
Check this voodoo out: Embed your UITextField within a UIScrollView. I tried it on the project you referred to and it worked.
I guess it has something to do with changing the responder chain that messes things up.

UIDatePicker in PopoverView in iPad

I have an iPad specific application running iOS 3.2.2 which displays a settings view in a ui popover. This all renders great, but now I'm trying to get a date picker to render inside the view and not sure what the best approach is for displaying it.
Right now it has a button which toggles visibility of the date picker within the modal, but that seems very clumsy for managing dismissal compared to the normal approach of an action sheet.
I haven't been able to find a 'best practice' for this situation and was wondering if anyone's run into this before and could offer some suggestions or guidance.
Thanks!
pls check the solution provided in the link .. might help you .
1. Create the UIDatePicker programmatically (don’t use the IB)
2. add it to the view after the popup is shown
http://omegadelta.net/2010/06/04/ipad-simulator-crashes-if-a-uidatepicker-is-in-a-uipopovercontroller/
Note the answer here indicating that the UIPickerView must be the root view of your controller when presented in a popover. It sounds like you may be attempting to place the date picker as one of several views inside the popover. If so, you'll encounter the problem described here.
trying to fix this error: Could not find mapped image UIPickerViewFrameLeft-162-Popover.png

Resources