开发者

In an iPad SplitView, how do I add a Date Picker control to the Root View?

开发者 https://www.devze.com 2022-12-30 18:37 出处:网络
I\'m diving into iPhone OS development on the iPad and one of the things I\'m playing with is the SplitView template.The template provides a window with a UISplitView view, containing the Root View (o

I'm diving into iPhone OS development on the iPad and one of the things I'm playing with is the SplitView template. The template provides a window with a UISplitView view, containing the Root View (on the left of the window) and the Detail View (on the right of the window). The Root View is a subclass of a TableView. Rather than having the entire Root View consist of a TableView, I'd like it to contain a DatePicker view along with the TableView under it. When I go into IB and try and drop a DatePicker into the Root View, it won't let me. It will only let me add a DatePicker view to the Detail View.

  1. Why wont IB let me drop a DatePicker view into the Root View?
  2. How can I add a DatePicker to the RootView in addition to the TableView?

I'm still learning this new platform, so I apologize if these questions are absurd in any way. Thanks so much in advance for your help, I'm going to continue r开发者_开发问答esearching these questions right now.


Why wont IB let me drop a DatePicker view into the Root View?

For starters, RootViewController is a UITableView. You can't add a UIDatePicker to a UITableView.

How can I add a DatePicker to the RootView in addition to the TableView?

If you want to add a UIDatePicker, you have to replace RootViewController with a UIViewController then add a UITableView and UIDatePicker.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号