在Android中:Intent对象,通知松散耦合的Activity等组件
在IOS中:Segue对象连接视图
1 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="99" translatesAutoresizingMaskIntoConstraints="NO"> 2 <rect key="frame" x="20" y="357" width="560" height="30"/> 3 <state key="normal" title="Call History"> 4 <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> 5 </state> 6 <connections> 7 <segue id="402" destination="101" kind="show"/> 8 </connections> 9 </button>
Segue连接视图,只能按部就班的导航到指定的视图,如果需要控制导航方向。我们需要代码控制:
Segue作为视图之间的桥梁,如果没有这个特定的桥梁,那么我们可以控制导航的方向-通过代码
通过注册在画板上的 Storyboard ID 到特定的视图,我们可以打开视图:
1 CallHistoryButton.TouchUpInside += (object sender, EventArgs e) =>{ 2 // Launches a new instance of CallHistoryController 3 CallHistoryController callHistory = this.Storyboard.InstantiateViewController ("CallHistoryController") as CallHistoryController;//从画板中加载对应的控制器级联对象 4 if (callHistory != null) { 5 callHistory.PhoneNumbers = PhoneNumbers; 6 this.NavigationController.PushViewController (callHistory, true); 7 } 8 };