DennisWelu
DennisWelu

Reputation: 848

Why no back button on DateElement picker?

This walkthrough for MT.D shows a back button on the UIDatePicker that appears when a DateElement is tapped. I'm in an iPad app, and using an MT.D DialogViewController as a subview in an overall UIView. When the date picker slides up I just get the black background with no way to dismiss the picker (no nav bar w/ back button). Same problem exists for the radio group picker. Is this because the dialog view controller is being used as a subview? Any ideas how I might get a nav bar up with a back button using the built-in picker logic?

Upvotes: 4

Views: 325

Answers (1)

Krumelur
Krumelur

Reputation: 33058

You must use the DialogViewController as a child element of a UINavigationController to get the back button. On iPad, you can embed the UINavigationController in a UIPopoverController. Adding the view of a controller into the view of another controller is not considered good design on iOS and won't result in the behavior you expect.

Upvotes: 1

Related Questions