简体   繁体   English

如何将控件从一个uiview移到iphone中的另一个uiview?

[英]how to move the control from one uiview to another uiview in iphone?

我创建了一个uiview(带有两个按钮),每当我单击任意一个按钮时,它都将覆盖整个屏幕,我想在上一个屏幕上转移我的控制权,该怎么办?

code for navigating from one view to another is as belove : 从一个视图导航到另一个视图的代码就像belove:

DetailViewController *detailViewController;
[self.navigationController pushViewController:detailsViewController animated:YES];

and for going back : 并返回:

[self.navigationController popViewControllerAnimated:YES];

leave comment if have any trouble... and click on correct sign if its correct...and votes up the answer to help another guys to see it. 如果有任何问题,请发表评论...,如果正确,请单击正确的标志...,然后对答案进行投票,以帮助其他人看到它。

if you are using NavigationController than for going back to previous view... 如果您使用NavigationController而不是返回上一个视图...

[self.navigationController popViewControllerAnimated:YES];

Otherwise 除此以外

[self dismissModalViewControllerAnimated:YES];

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

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