2013-06-18 7 views
0

Я делаю проект, где мне нужно показать такое мнение, я попытался использовать представление таблицы, но я не смог реализовать, после чего я решил реализовать это с помощью коллекции view.but ничего плодотворного не произошло .i получить frustated здесь, потому что ничего не может произойти с моим представлением. Это текстовые поля, добавленные в представление, и все доступны для просмотра, может ли кто-нибудь помочь мне в этом, я более свеж, поэтому, пожалуйста, помогите мне.Как добавить текстовые поля на просмотр uicollection?

enter image description here

+0

Я думаю, что это может быть сделано с помощью сгруппированного Tableview. Проверьте документацию http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/tableview_iphone/tableviewstyles/tableviewcharacteristics.html – iCoder

+0

Это можно сделать, используя tableview, настроив его ячейку. –

+0

@Norbert я попробовал это с помощью вида таблицы, но не смог реализовать. Пожалуйста, предложите мне другой способ. – Priyanka

ответ

0
////////////////// 
    - (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 { 

} 
+0

Хорошо, я попробую this.thank вам за помощь, и, пожалуйста, скажите мне, как получить ответ от каждого текстового поля. – Priyanka

+0

использовать делегаты текстового поля –