-1
我正在使用iPad應用程序。我正在使用UITableView
來創建表格並在每個單元格中插入2 UIImageView
。我試圖在UIImageView
s中設置圖像,但是索引路徑值從0,1,2,3,4等開始...iPad中的UITableView問題?
每個UIImageView
在第一個單元格中具有相同的圖像。如何解決這個問題?
例子:
- (void)viewDidLoad
{
[super viewDidLoad];
// ImageArray have 5images;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [ImageArray count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
imgView1.image = [imageArray objectAtIndex:indexPath.row];
imgView2.image = [imageArray objectAtIndex:indexPath.row];
}
你在哪裏設置UIImageView,我的意思是它設置爲cell.contentView? – iPatel 2013-02-09 10:50:29
格式化你的問題 – 2013-02-09 10:50:38
和wt你想顯示在輸出? – iPatel 2013-02-09 10:50:53