Tag: 滚动

iOS UITableView单元格滚动后加载不正确?

我在视图中有2个UITableView,我只在第2行第5行和第7行添加了UITableViewCellAccessoryDisclosureIndicator。 但滚动第二张表(第一行消失),然后滚动回顶部(哪一行出现),第一行现在有UITableViewCellAccessoryDisclosureIndicator ?! 第1行莫名其妙地变成了第5行还是第7行? 以下是我的代码cellForRowAtIndexPath: – (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]; } cell.textLabel.textColor = [UIColor blueColor]; cell.detailTextLabel.textColor = [UIColor blackColor]; if (tableView == table1) { cell.textLabel.text = [title1 objectAtIndex:indexPath.row]; cell.detailTextLabel.text = [list1 […]

iOS:uitableview将第一个单元格上的对象重绘到底部单元格

我有一个自定义的单元格与正常的代码 – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; DDMainCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; if (cell == nil) { cell = [[DDMainCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } } 问题是,当我select一个单元格,我在网上下载数据的单元格上添加进度栏..但是,当我向下滚动,我发现,每10个单元格有相同的进度条..我如何防止这种行为?

ios – Swift – dequeueReusableCellWithReuseIdentifier,collectionViewController的单元格(在UIView中)滚动后不会加载

我有一个ViewController 3视图: 标题(UIView) TabBar(UIView) UIView3(UIView) 在我的UIView3我有一个collectionViewController。 一个关键的因素是,我把我的collectionViewController.scrollEnable = False因为另一方面,当我滚动,只有UIView3滚动,我希望我entier屏幕滚动(这样,如果我们足够的滚动我的标题和Tabbar被隐藏。 所以这就是我所拥有的: 这就是我的屏幕的样子: 这是完美的。 但是 ,当我向下滚动时,这应该是这样的: 但是 ,看起来像这样: 我认为我的问题来自“dequeueReusableCellWithReuseIdentifier”函数,它没有看到我正在滚动,但我不知道如何“刷新”滚动值,因此它加载单元格3-4的末尾,也单元格5- 6。 你有什么主意吗 ?

popup窗口中的UITableView不会滚动

我正试图解决某人的代码,并遇到一个问题。 这是情况:我有一个全屏UIViewController有一个底部的栏button。 当我按下该button时,它会在屏幕左下angular显示一个popup视图控制器。 popup窗口中的视图控制器也有一个button,当我按THATbutton时,它将一个新的视图控制器到我的popup窗口。 这个新的视图控制器是一个UITableView,可以有大量的元素。 问题是,当我尝试向下滚动以查看一些离屏元素时,滚动会弹回到表中的第一个位置,即它不会真的滚动。 更具体的是这里是一些代码: 在FullScreenVC.h中: @property (nonatomic, retain) NSMutableArray* stuffInList; @property (nonatomic, retain) UIPopoverController *namePopover; @property (nonatomic, retain) UINavigationController *nameNav; @property (nonatomic, retain) UIBarButtonItem* addButton; 内FullScreenVC buttonPressed(按下addButton时调用): FirstPopupVC *vc=[FirstPopupVC alloc] initWithNibName@"FirstPopupVC" bundle:nil]; vc.delegate=self; vc.stuffInList=self.stuffInList; // This is just the NSArray of list items self.nameNav = [[[UINavigationController alloc] initWithRootViewController:vc] autorelease]; self.namePopover = [[[UIPopoverController […]

iOS UITableView在滚动时崩溃

我在这里遇到了一个奇怪的问题。 我正在开发一个iOS应用程序(特别是iPad),我在某个时候使用UITableView来显示一个列表。 现在,当我在视图的边界内滚动(不在第一个元素上面,而不是在最后一个元素下面)时,它可以正常工作。 然而,当我滚动的时候,它只是猛烈地崩溃,没有其他消息: 当我向下滚动到最后一个元素时, EXC_BAD_ACCESS 当我滚动比第一个更高时,带有回溯的SIGABRT 我看着谷歌,似乎我释放一些对象太多,但我无法弄清楚哪些。 我也尝试在乐器中运行应用程序,但每次运行应用程序时,乐器窗口都会冻结,迫使我用手杀死它…当然,我得不到任何结果… 这里有一些相关的代码: /* Returns the cells of the table view */ -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { // Create a new cell view static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } // […]

滚动时表格视图返回错误的值

问题是我已经实现了一个表格视图与故事板的自定义单元格。 每个单元格都有一个button作为selectbutton,这意味着每当我按下一个button时,它的图像就会变化。 例如,如果我按下单元索引= 0的button,它的图像正确改变,但是当滚动表时我发现​​其他button也改变了他们的图像! 问题是从表索引path,我花了很多时间试图解决它没有结果。 任何解决scheme 谢谢 static NSString *simpleTableIdentifier = @"cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:simpleTableIdentifier]; NSLog(@"index path inside cell = nil %i",(int)indexPath); } buttonObj=(UIButton *)[cell viewWithTag:40]; [buttonObj addTarget:self action:@selector(select:) forControlEvents:UIControlEventTouchDown]; return cell; -(void) select:(id)sender{ UIButton *button=(UIButton *)sender; UITableViewCell *clickedCell = (UITableViewCell*)[[sender superview] […]

为什么UIScrollView无法在iOS模拟器中滚动?

我试图熟悉UIScrollView 。 我尝试将UIScrollView's contentSize设置为屏幕的full width ,并在相应的ViewController's viewDidLoad方法中将屏幕的高度设置为ten times 。 但是,当我试图在iOS simulator上运行它时,我发现视图无法scrolled 。 请给予一些提示和意见。 谢谢!

以编程方式停止-webkit-overflow-scrolling

我有一个PhoneGap应用程序,使用iOS本地滚动通过-webkit-overflow-scrolling的div。 我希望能够在用户点击一个button(滚动回页面顶部)时手动停止正在进行的滚动。 这是可行的吗?

bootstrap – IOS上没有滚动条?

我正在使用引导版本2.x,当我在非移动浏览器上使用应用程序的滚动条正常工作,但是当我浏览使用iOS(iphone 5)没有滚动条 – 特别是垂直滚动条,我不能触摸滚动屏幕 – 它只是固定我不能更多的左或右或上或下…… 有什么我需要启用触摸滚动像一个不同的JS库吗? 或者是有什么坏的。 我已经阅读,如果标签没有正确closures这可能会发生,但我的标签是封闭的。 所以基本上我所有的内容现在都不可见了,除了第一部分我不能向下滚动… 这里是一些代码(我使用杜兰达作为SPA) 这是我的shell: <div> <header> <!–ko compose: {view: 'nav'} –><!–/ko–> </header> <section id="content" class="main container-fluid"> <!–ko compose: {model: router.activeItem, afterCompose: router.afterCompose, transition: 'entrance'} –> <!–/ko–> </section> <footer> <!–ko compose: {view: 'footer'} –><!–/ko–> </footer> </div> 此刻我删除了所有的“导航”和“页脚”渲染,只有在内容HTML呈现在那里一个简单的页面: <section> <div> <button id="btnrefresh" class="btn btn-info btn-force-refresh pull-right"><i class="icon-refresh"></i> Refresh</button> <button […]

UIScrollView里面的UICollectionView不滚动

我有一个垂直滚动滚动视图,有一个子视图。 这个子视图有几个集合视图。 我希望他们水平滚动。 它不工作,因为它们在滚动视图内。 问题在于平移/滚动手势仅适用于滚动视图,并且不会传播到集合视图。 我只看到滚动视图滚动。 在收集单元上点击也是一样的问题。 这个事件不会发生。 我已经尝试手动添加手势,但我无法滚动收集视图。 我怎样传播所有的手势? 谢谢 ! ] 1