美文网首页
表格跳转

表格跳转

作者: 26aa4a305186 | 来源:发表于2018-12-21 08:22 被阅读0次

//首先在viewdidload写个方法

-(void)collectionView:(UICollectionView*)collectionView didSelectItemAtIndexPath:(NSIndexPath*)indexPath{

    NSLog(@"第%ld分区---第%ld行",indexPath.section,indexPath.row);

    NewViewController  *new = [[NewViewController alloc]init];

    NSString*str =_dic.allKeys[indexPath.section];

    NSString*name = [[[_dicobjectForKey:str]objectAtIndex:indexPath.row]allKeys][0];

    new.name= name;

    new.img= [UIImageimageNamed:[[_dicobjectForKey:str]objectAtIndex:indexPath.row][name]];

    [self presentViewController:new animated:YES completion:nil];

}

//然后创建一个新的页面,.h写上name,image属性

//然后在.m写内容

-(UIImageView*)imageView{

    if (!_imageView) {

        _imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-50)];

    }

    return _imageView;

}

-(UILabel*)label{

    if(!_label) {

        _label= [[UILabelalloc]initWithFrame:CGRectMake(200,self.view.frame.size.height-40,200,30)];

    }

    return _label;

}

- (void)viewDidLoad {

    [super viewDidLoad];

    self.view.backgroundColor = [UIColor whiteColor];

    [self.viewaddSubview:self.imageView];

    [self.viewaddSubview:self.label];

    self.imageView.image = self.img;

    self.label.text=self.name;

}

-(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event{

    [self dismissViewControllerAnimated:YES completion:nil];

}

相关文章

  • 表格跳转

    //首先在viewdidload写个方法 -(void)collectionView:(UICollectionV...

  • Excel——04浏览

    Excel浏览大表格技巧 1. 跳转到文件末尾 ctrl + ↓ 2. 冻结窗格 在滚动表格时可以锁定行或列,让其...

  • vue element数据更新,表格不更新

    点击弹窗的取消之后,再点跳转页面,跳转回来,表格数据不刷新了。 原来是el-table没加row-key, 加上就...

  • 微信小程序 页面跳转

    App.json中配置页面信息 按钮的点击事件 bindtap 实现页面跳转 表格 日期控件

  • vue+element ui 表格+el-link跳转页面

    vue+element ui 表格+el-link跳转页面 效果展示: 实现过程: 通过template的slot...

  • vue 调试api接口详情2

    表格中查看接口调试 1、最终效果如下,在查询出用户参与的所有项目后,在表格右侧操作那里点击跳转到具体项目详情 2、...

  • Angular 使用 Resolve 预先获取组件数据

    这几天碰到一个需求,登录后要根据用户信息的不同跳转到不同的页面。比如默认登录要求跳转到A页面,如果A的页面中表格数...

  • 用响应式方法,编写可状态回滚的webApp

    实际项目遇到的问题 在项目上,遇到了表格翻页到若干页,再跳转到其它页面,然后返回到当前页面时,页码和表格翻页无法保...

  • 表格cell点击跳转的使用

    一.首先在APPDelegate中创建导航条 二.在ViewController中创建表格及跳转 import U...

  • gridview 做排班 课表

    项目要求,做未来14天的排班表格,每个时段的表格都能点击跳转思路如下: 1、初始化未来14天的日期数据2、将每一天...

网友评论

      本文标题:表格跳转

      本文链接:https://www.haomeiwen.com/subject/njbpkqtx.html