I. Building the main interface,. Set self . Navigationitem. The Leftbarbuttonitems property.
- Because Leftbarbuttonitem is created from a xib file, controls created by Xib change by default following the size of the parent control
- Workaround: Cancel the Xib AutoLayout, cancel the xib height auto stretch and width auto stretch
- Custom controls require the outside world to change the displayed picture and text, so the following methods are available to set the picture and text that you display
Two. Leftbarbuttonitem is displayed by PopOver after clicking, and it shows a cascading menu with two TableView, which customizes the view of the cascading menu (Lrtableview below). Add the custom control to the corresponding controller. But Lrtableview needs to be provided with data to display the desired content.
- Workaround one: To provide a model data to be displayed externally, this method causes the Lrtableview to be too dependent on the model properties, if the model attributes too much, not only to determine what the model passed, but also not control
- Solution Two: Imitation of Apple's TableView, to their own Lrtableview also write a data source, write a proxy (this is used here), Lrtableview need data when you do not have to rely on model properties, directly ask data source to data.
Data source Protocol:
Agent Agreement:
ipad Development-The setup of the PopOver interface (mainly for the use of the device, and monitoring)