0

在 iOS 中,我基本上想按如下方式显示图像:

我需要一个表中的 2 列。第一列中的图像是固定的,第二列中的行应该具有水平滚动以滚动图像。在选择图像时,它应该转到另一个视图。

4

2 回答 2

0

您需要遵循本教程以及类似的教程。

有关如何修复第一个图像的详细信息,没有比从头开始,按照书本更好的方法了。

于 2013-03-21T09:35:44.960 回答
0
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

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

    if(indexPath.row == 0){

        //Normar cell

    }else if(indexPath.row == 1){

        //add ScrollVeiw
    }
}

和单元格的高度

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

    if (indexPath.row == 1) {
        //height for scrollview

    }
}

希望这会帮助你。

一切顺利 !!!

于 2013-03-21T09:36:47.363 回答