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