ios - UITableview 尝试 scrollToTop 但没有(指标试图上升,奇怪。)- 视频

标签 ios objective-c uitableview

所以我一直在研究 UITableView,但我无法点击状态栏来向上滚动,但它似乎正在尝试向上滚动,但实际上并没有。

在这里你可以看到它的视频(决定使用 mp4 而不是 GIF,因为它太慢了) http://i.gyazo.com/4c7be7437116e420411ac879b6d0d784.mp4

如果您观看视频,您会发现右侧的指示器试图向上滚动但没有?有没有人经历过类似的事情?

我也在使用 ECSlidingViewController

我当前的代码 调用 -viewDidLoad

-(void)setTableViewStuff {

    [self.myTableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];

    [self.myTableView registerNib:[UINib nibWithNibName:@"YouTubeTableCell" bundle:nil] forCellReuseIdentifier:CellIdentifier];


       self.myScrollView.scrollsToTop = NO;
    self.myTableView.scrollsToTop = YES;
}

表格 View 代码

#pragma mark - Table View



- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 256;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return myVideoTitles.count;
}



// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    YouTubeTableCell *cell = (YouTubeTableCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];


    if (cell == nil) {
        //cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
        //cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }

    if (indexPath.section == 0) {
        NSString* thumbnailURL = myVideoThumbnails[indexPath.row];
     [cell.myThumbnail setImageWithURL:[NSURL URLWithString:[thumbnailURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] placeholderImage:nil];

    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the specified item to be editable.
    return NO;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

}

编辑: 找到了解决方案!!如果您使用的是 ECSlidingViewController,则 Apperiantely 您必须有 yourtableview.scrollstotop = NO; “抽屉”里面

最佳答案

找到了解决这个问题的方法!,如果你使用 ECSlidingViewController,你必须有 yourtableview.scrollstotop = NO;在“抽屉”里面

关于ios - UITableview 尝试 scrollToTop 但没有(指标试图上升,奇怪。)- 视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23451778/

相关文章:

ios - UICollectionViewLayout(从 Swift 转换为 Objective-C)

ios - 在 IOS 上存储照片的最佳后端服务器

ios - 当应用程序从后台返回时,进度 HUD 卡住 - iOS

iphone - 我如何从 iOS 框架中删除或重命名符号?

ios - 将 GCD 与 TableView 一起使用会导致间歇性断言

ios - UIImageView 中的大小限制?

ios - 应用程序拒绝 - 子类别

ios - ObjC、Facebook 页面 - 发布新闻提要有效,但发布照片无效

ios - 重新加载数据时刷新 tableView 闪烁

ios - 在 swift 3 中重新加载部分方法?