2012-01-22 75 views
0

我正在开发biblkereder应用程序n iPhone/ipad我已成功完成iPhone应用程序,但在iPad中,我需要多个coloum视图来显示verses.i使用tableview来显示verses.if章含50节它需要在两个colums 25 twetyfive.i有很多搜索在谷歌这个implkemntaion显示,但根据章我没有得到正确的教程UITableView中的多列

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 
    return 1; 
} 


// Customize the number of rows in the table view. 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 

     return [delegate.allSelectedVerseEnglish count]; 
    } 
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 

    static NSString *CellIdentifier = @"Cell"; 

    readCell *cell = (readCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
    if (cell == nil) { 
     cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier 

       ] autorelease]; 
     NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"readCell" owner:self options:nil]; 
     cell = [nib objectAtIndex:0]; 


     cell.textLabel.font = [UIFont fontWithName:@"Georgia" size:18.0]; 
     cell.textLabel.lineBreakMode = UILineBreakModeWordWrap; 
     cell.textLabel.numberOfLines = 0; 

     table.opaque = YES; 
     table.backgroundColor = [UIColor clearColor]; 
     table.separatorColor = [UIColor clearColor]; 
     cell.chapterAndVerse.text = [NSString stringWithFormat:@"%d",indexPath.row+1]; 
     cell.chapterAndVerse.frame=CGRectMake(0, 10, 20.0, 20.0); 
     cell.textLabel.text = [NSString stringWithFormat:@" %@",[delegate.allSelectedVerseEnglish objectAtIndex:indexPath.row]]; 
     cell.textLabel.font = [UIFont fontWithName:@"Georgia" size:18.0]; 
     cell.backgroundColor = [UIColor clearColor]; 
} 

这个代码diaplying诗句在iPhone中,但我需要一个像iPad中的杂志应用程序一样的splitvew。 chapteranderse是标签。 delegate.allSelectedVerseEnglish他们走了,其中包含经文。 在此先感谢。

回答

1

为什么不使用两个表视图?

这是我的想法..在屏幕上添加两个表视图..给他们sperate标签和在第一表的单元格的触摸重新加载第二个表..

+0

啊ü说thing.but问题的正确我们如何将字符串拆分为两个tableiews ??? – stackiphone