当前位置: 首页 > news >正文

手机做网站多少钱地推app接任务平台

手机做网站多少钱,地推app接任务平台,旧宫网站建设,绿化公司和苗圃做网站界面切换 push和poppresent和dismiss示例程序 push和pop 在 Objective-C 中,pop 和 push 通常是与 UINavigationController 一起使用的方法,用于控制导航栈中视图控制器的跳转和回退。 push 和 pop 通常成对使用,用于实现导航栈的前进和后退功能。当用户进入新的视图控制器时…

界面切换

  • push和pop
  • present和dismiss
  • 示例程序

push和pop

在 Objective-C 中,pop 和 push 通常是与 UINavigationController 一起使用的方法,用于控制导航栈中视图控制器的跳转和回退。

  • push 和 pop 通常成对使用,用于实现导航栈的前进和后退功能。
  • 当用户进入新的视图控制器时,使用 push 方法将其加入导航栈;
  • 当用户需要返回上一个视图控制器时,使用 pop 方法从导航栈中移除当前视图控制器。

push的代码格式:

[self.navigationController pushViewController:two animated:YES];

pop的代码格式

//返回上一视图控制器
[self.navigationController popViewControllerAnimated:YES];
//返回根视图控制器
[self.navigationController popToRootViewControllerAnimated:YES];
//返回到指定的控制器
[self.navigationController popToViewController:one animated:YES];

present和dismiss

在 Objective-C 中,present 和 dismiss 是与视图控制器相关的两个重要概念,它们描述了视图控制器的呈现和关闭行为。present 用于以模态方式呈现一个新的视图控制器。dismiss 用于关闭当前模态呈现的视图控制器,返回到上一级视图控制器。

区别与联系:

  • present 和 dismiss 是相对的概念,present 用于呈现新的视图控制器,dismiss 用于关闭当前视图控制器。
  • 通常情况下,一个视图控制器被 present 之后,需要通过 dismiss 方法来关闭自己,返回到上一级视图控制器。

示例代码:

[self presentViewController:three animated:YES completion:nil];
[self dismissViewControllerAnimated:YES completion:nil];

示例程序

在这里插入图片描述
VCone.m:

#import "VCone.h"
#import "VCtwo.h"
@interface VCone ()@end@implementation VCone
@synthesize item = _item;
- (void)viewDidLoad {[super viewDidLoad];self.view.backgroundColor = [UIColor redColor];_item = [[UIBarButtonItem alloc] initWithTitle:@"下一页" style:UIBarButtonItemStylePlain target:self action:@selector(pressRight)];self.navigationItem.rightBarButtonItem = _item;
}-(void) pressRight
{VCtwo* two = [[VCtwo alloc] init];[self.navigationController pushViewController:two animated:YES];}/*
#pragma mark - Navigation// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {// Get the new view controller using [segue destinationViewController].// Pass the selected object to the new view controller.
}
*/@end

VCtwo.m:

#import "VCtwo.h"
#import "VCone.h"
#import "VCthree.h"
@interface VCtwo ()@end@implementation VCtwo
@synthesize btn = _btn;
@synthesize btn1 = _btn1;
- (void)viewDidLoad {[super viewDidLoad];self.view.backgroundColor = [UIColor greenColor];_btn = [[UIBarButtonItem alloc] initWithTitle:@"上一页" style:UIBarButtonItemStylePlain target:self action:@selector(press)];self.navigationItem.leftBarButtonItem = _btn;_btn1 = [[UIBarButtonItem alloc] initWithTitle:@"下一页" style:UIBarButtonItemStylePlain target:self action:@selector(pressright)];self.navigationItem.rightBarButtonItem = _btn1;
}-(void) press
{[self.navigationController popViewControllerAnimated:YES];
}-(void) pressright
{VCthree* three = [[VCthree alloc] init];[self presentViewController:three animated:YES completion:nil];
}/*
#pragma mark - Navigation// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {// Get the new view controller using [segue destinationViewController].// Pass the selected object to the new view controller.
}
*/@end

VCthree.m:

#import "VCthree.h"
#import "VCtwo.h"
@interface VCthree ()@end@implementation VCthree- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view.self.view.backgroundColor = [UIColor yellowColor];
}-(void) touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{[self dismissViewControllerAnimated:YES completion:nil];
}/*
#pragma mark - Navigation// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {// Get the new view controller using [segue destinationViewController].// Pass the selected object to the new view controller.
}
*/@end

效果图

在这里插入图片描述

http://www.dt0577.cn/news/27993.html

相关文章:

  • 做淘宝网站要安全保障么软文广告代理平台
  • flash网站免费源码带后台百度推广产品有哪些
  • 网站建设相关关键词推广品牌的方法
  • 文网站建设费用计入什么科目澳门seo关键词排名
  • 网站建设实施方案鸿科经纬教网店运营推广
  • 付公司网站建设费用会计分录免费公司网址怎么注册
  • seo优化排名方法seo网站优化推广
  • 百度联盟怎么做自己的网站搜索引擎营销的主要方式有哪些?
  • 网站备案工作站长统计app软件下载2021
  • 做素材网站如何赚钱深圳最好seo
  • 网站中文域名到期怎么收录网站
  • 丹东网站优化苹果cms永久免费全能建站程序
  • 两学一做网站是多少钱营销培训方案
  • 白沟17网站一起做网店无线网络优化工程师
  • 用dw做网站图片的基本尺寸seo核心技术排名
  • php做网站后台教程百度用户服务中心人工24小时电话
  • 安岳建设局网站网络搜索引擎有哪些
  • 网站改版一般需要多久百度助手app免费下载
  • 怎么建网站手机版百度指数可以用来干什么
  • 洮南网站建设哪家专业网站关键词推广
  • 重庆网站建设-首选云慧通网站外部优化的4大重点
  • 游戏网站的监管由谁来做谷歌google下载
  • 百度做网站多少钱能做湖南seo推广软件
  • 如何制作网页网站参考网是合法网站吗?
  • 苏州那里可以建网站哪些平台可以发布软文
  • 招聘网站上还要另外做简历吗微博推广有用吗
  • 网上订餐网站模板百度小程序对网站seo
  • 长春做网站公司搜索关键词软件
  • 做网站一般什么问题湖南seo公司
  • 网站建设的未来网站搭建