UIDatePicker in PopoverView in iPad - ios

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

Related

Which control should I use to display an ActionSheet-like view at the top of the screen?

I was asked to display a list of three options for the user in a View sliding from the top to bottom. They say it should slide from the top because the action is initiated from a dropdown-like button on the navigation bar.
Most of what I found on that subject mentions the deprecated UIActionSheet class.
The "new" way using UIAlertController doesn't seem to allow us to change position of the view. At the least from what I've found.
The end result I'm trying to get can be seen on the image below,
From what I've learned about iOS programming, one method I could think to achieve that would be to create a new UIViewController and to use a custom class to control the transition. But it just seems so much. And I think it wouldn't not look like a dropdown afterall.
The other option would be to create the TableView with options and leave it on the Controller where it should be displayed, configuring its height to zero. And then Animating when necessary. I also have such a bad feeling doing it this way.
Is there a right way to do this on iOS? Does one of the options I've found seems acceptable?
Thanks.
Following the suggestion given by #Losiowaty on the comments, I started looking for a custom View/Control on cocoapods and ended up finding quite a few that did what I was looking.
The one I decided to use is this:
https://github.com/lminhtm/LMDropdownView

UIDatePicker not displaying correctly

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

How to load another UIViewController to a UIView Example Like UITabbarController

I have a 2 UIViewController(s), I need to be able to change the views at the bottom of the Airtime and Data Plan Upon tap gesture on Airtime and Data Plan!
The yellow line will indicate the active view controller. some thing like tab bar.
Perhaps, the image attached is an android version
Could anyone provide a help on how to go about this.
Thanks
I personally use a library called ICVIewPager
https://github.com/iltercengiz/ICViewPager
This is pretty simple and easy to use with examples. It should put you in the right direction without writing a lot of code.

Sliding drawer equivalent in iOS

After wasting lot of time searching, I am finally posting this question, hoping I get an answer.
I want to have a widget in iOS, which has the similar functionality of Sliding Drawer in Android. (Like the bar at the bottom, and on pulling it, it shows up a new view).
Any help would be greatly appreciated.
Thanks
A few similar questions that might help you out:
Making a pull out tray - (iOS)
iOS: Sliding UIView on/off screen
I recently made a drawer container controller and put it up on Github:
https://github.com/saldavonschwartz/DrawerContainerController
While not exactly the same (you are asking about a vertical single view sliding up/down), you might want to download the code and take a look. My approach might as well work for what you are trying to do: basically, creating a container controller which can host another controller and its view and present its view in a custom way.
Specifically, you might want to look at:
-replaceContainedController:forIdentifier: for how you would go about adding child view controllers the 'Apple' way.
-didPanContent: and -translateContentContainerViewToPosition:animated:completion: for the sliding animation from input of a UIPanGestureRecognizer

Titanium Mobile - Create an iPad Popover in NavBar

I am currently playing around with Titanium Mobile and trying to create and populate a popover when a button in the NavBar (at the top) is clicked. Currently, the popover is created, but it's not populated with any data. (I'm trying to populate it with a view from my file "category_list.js").
Here's what I have tried so far: http://pastie.org/2145045
The problem is: The popover shows up, but it's not being populated with any data.
UPDATE: More specifically, after looking around, I guess what I am trying to do is create a navigation group within a popover. Apparently, this forum post says it's possible.
But I can't seem to figure it out. If anyone can provide a concrete example of how a navigation group works within the context of a popover using Appcelerator, it would help me out tremendously.
Any help would be greatly appreciated! Thanks.
http://blog.clearlyinnovative.com/post/7182213033/titanium-appcelerator-quickie-ipad-popover-with
I wonder if if has anything to do with popover.add(categories_list); being called once at line 18 and once in the click event at line 73. When I've worked with popovers in the past you only need to add to it once. Let me know if this gets you anywhere closer to a solution?
The other problem I see that I'm 99% sure is causing this issue is the popovers don't adjust auto to the child view height and width. Try adding height: 300, width: 250 when creating the popover.

Resources