所以我一直在研究 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/