相关疑难解决方法(0)

使UITableView可以通过索引滚动

我正在尝试创建一个UITableView索引来更快地滚动一个大UITableView,我有索引显示在右边但当我尝试滚动它,它不起作用..

截图

我想知道我是否遗漏了一些东西,所以我想知道是否还有别的东西需要做,或者其他什么.

#pragma - TableView Index Scrolling

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {

    if(searching)
        return nil;

    NSMutableArray *tempArray = [[NSMutableArray alloc] init];
    [tempArray addObject:@"A"];
    [tempArray addObject:@"B"];
    [tempArray addObject:@"C"];
    [tempArray addObject:@"D"];
    [tempArray addObject:@"E"];
    [tempArray addObject:@"F"];
    [tempArray addObject:@"G"];
    [tempArray addObject:@"H"];
    [tempArray addObject:@"I"];
    [tempArray addObject:@"J"];
    [tempArray addObject:@"K"];
    [tempArray addObject:@"L"];
    [tempArray addObject:@"M"];
    [tempArray addObject:@"N"];
    [tempArray addObject:@"O"];
    [tempArray addObject:@"P"];
    [tempArray addObject:@"Q"];
    [tempArray addObject:@"R"];
    [tempArray addObject:@"S"];
    [tempArray addObject:@"T"];
    [tempArray addObject:@"U"];
    [tempArray addObject:@"V"];
    [tempArray addObject:@"W"];
    [tempArray addObject:@"Y"];
    [tempArray addObject:@"X"];
    [tempArray addObject:@"Z"];

    return tempArray;
} …
Run Code Online (Sandbox Code Playgroud)

iphone indexing uitableview ios

17
推荐指数
2
解决办法
2万
查看次数

标签 统计

indexing ×1

ios ×1

iphone ×1

uitableview ×1