小编Lia*_*and的帖子

如何删除UITableView中的缩进?

首先,我是新手,我很可能会忘记一些非常简单的事情.

题:

我正在制作一个应用程序,显示来自imgur.com的随机图像tableView.由于某些原因,所有单元格都缩进了一小部分,如下图所示.我已经摆弄了许多设置storyboard并且没有运气来修复问题.

注意图像左侧的缩进

这是tableView代码......

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
return (_images.count * 2);
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = nil;

if (indexPath.row % 2 == 0) {
//content cell
    cell = [tableView dequeueReusableCellWithIdentifier:@"RandomImgurTableCell"];

    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
                                       reuseIdentifier:@"RandomImgurTableCell"];
    }

    long row = [indexPath …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uitableview ios

5
推荐指数
2
解决办法
8505
查看次数

标签 统计

ios ×1

iphone ×1

objective-c ×1

uitableview ×1