简体   繁体   English

如何在情节提要模式Xcode中更改按钮功能

[英]How can I change button function in Storyboard mode Xcode

I am new to developing apps for iOS devices, and I just tried out storyboard mode. 我是为iOS设备开发应用程序的新手,我只是尝试了演示图板模式。 I wanted to know if there was a way to change the function of the button, for example, I have three pages, and on the first page I have two buttons, one that leads two the next page and a button that leads to the third page? 我想知道是否有一种方法可以更改按钮的功能,例如,我有三页,而在第一页上,我有两个按钮,一个导致下两个页面,另一个导致第三个页面。页?

I would really appreciate an answer. 我真的很感谢一个答案。 Thanks 谢谢

Cant you just control drag from the button to the page you want it to lead to? 您只能控制从按钮拖动到您要引导的页面吗? that is how storyboard works. 这就是情节提要的工作原理。

IMPORTANT: to go back you DO NOT create a button and make drag it back, instead you create a button and set the code for that button to dismiss the view controller. 重要说明:要回去,请勿创建按钮并将其拖回,而应创建一个按钮并为该按钮设置代码以关闭视图控制器。

You can still use the old method in Interface Builder : drag the IBAction to your button. 您仍然可以在Interface Builder中使用旧方法:将IBAction拖动到按钮上。

If you plan to use segues, you have to define the segue name in Properties, and implements - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender method. 如果计划使用segues,则必须在“属性”中定义segue名称,并实现- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM