Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何在uicollection视图中添加文本字段?_Iphone_Tableview_Collectionview - Fatal编程技术网

Iphone 如何在uicollection视图中添加文本字段?

Iphone 如何在uicollection视图中添加文本字段?,iphone,tableview,collectionview,Iphone,Tableview,Collectionview,我正在做一个项目,在那里我必须显示这样的视图我尝试使用表视图,但无法实现,在此之后,我决定借助集合视图来实现此功能。但没有任何结果。我在这里感到沮丧,因为我的视图不会发生任何事情。这些是视图上添加的文本字段,所有这些字段都可以单击,有人能帮我吗?我是一名新手,请帮助我 ////////////////// - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section

我正在做一个项目,在那里我必须显示这样的视图我尝试使用表视图,但无法实现,在此之后,我决定借助集合视图来实现此功能。但没有任何结果。我在这里感到沮丧,因为我的视图不会发生任何事情。这些是视图上添加的文本字段,所有这些字段都可以单击,有人能帮我吗?我是一名新手,请帮助我

    //////////////////
    - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
    {
        if(section==0)
        {
            return self.view_header;
        }

        return nil;
    }

    - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
    {
        CGFloat height =0.00;

        if(section==0)
        {
            height = 32;
        }     

        return height;
    }

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 
    {    

        if(indexPath.section == 1)
        {
            return 51; 
        }
        else
        {
            return 35;
        }
    }



    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

        if(self.flag_loadCompleted == TRUE)
        {
            return 1;
        }
        return 2;
    }


    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {  

        if(section == 0)
        {
            return [self.arr_data count];
        }
        else if(section == 1)
        {
            return 1;
        }

        return 0;
    }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {    

    static NSString *CellIdentifier = @"MyTemplate";
    MyFinancialTemplate *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if(cell == nil)
    {
        cell = [MyFinancialTemplate createNewTextCellFromNib];
    }    
    cell.index = indexPath.row;  
    if(indexPath.section == 0)
    {
        cell.index = indexPath.row;
        cell.flag_loader = FALSE;

        cell.selectionStyle = UITableViewCellSelectionStyleGray;
    }
    else
    {
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.flag_loader = TRUE;
    }

    [cell LoadCell];

    return cell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {   

}

我认为这可以在分组tableView的帮助下完成。查看文档,这可以使用tableview来完成,自定义其单元格。@Norbert我在table view的帮助下尝试了它,但无法实现。请建议我其他方法way@steve我试过的作业也告诉我如何添加不同的文本字段&这些字段应该是响应的。你可以在tableview中有一个自定义单元格。基本上,假设所有字段都是可编辑的,您需要根据需要在每个单元格中添加8个文本字段。可以检查是否创建自定义单元格。这只是一个例子。您可以根据需要创建自己的文本域。好的,我会试试。谢谢您的帮助,请告诉我如何从每个文本域获得响应。使用文本域的代理