草庐IT

IndexPath

全部标签

ios - swift ios 向 uitableview 添加无限滚动分页

我想知道tableview是否有任何内置功能来添加无限滚动/分页。现在我的VC是这样的:vardata:JSON!=[]overridefuncviewDidLoad(){super.viewDidLoad()//Initstartheightofcellself.tableView.estimatedRowHeight=122self.tableView.rowHeight=UITableViewAutomaticDimensionself.tableView.delegate=selfself.tableView.dataSource=selfsavedLoader.startAn

ios - 将多个原型(prototype)单元格加载到 UITableView

我目前有一个包含2行自定义单元格的UITableView。我最近在Storyboard中添加了第二个原型(prototype)单元格,并试图将其添加到我的UITableView但没有成功。我的cellForRowAtIndexPAth方法如下:functableView(tableView:UITableView,cellForRowAtIndexPathindexPath:NSIndexPath)->UITableViewCell{letcell:FlightsDetailCell=tableView.dequeueReusableCellWithIdentifier("Cell",

ios - 将多个原型(prototype)单元格加载到 UITableView

我目前有一个包含2行自定义单元格的UITableView。我最近在Storyboard中添加了第二个原型(prototype)单元格,并试图将其添加到我的UITableView但没有成功。我的cellForRowAtIndexPAth方法如下:functableView(tableView:UITableView,cellForRowAtIndexPathindexPath:NSIndexPath)->UITableViewCell{letcell:FlightsDetailCell=tableView.dequeueReusableCellWithIdentifier("Cell",

ios - 在 Swift 中点击时展开单元格

我一直在尝试在我的应用程序中实现一项功能,以便当用户点击我的表格View中的单元格时,该单元格会向下扩展以显示注释。我在Objective-C中找到了很多这样的例子,但我还没有找到Swift的例子。这个例子看起来很完美:Accordiontablecell-Howtodynamicallyexpand/contractuitableviewcell?我曾尝试将它翻译成Swift:varselectedRowIndex=NSIndexPath()overridefunctableView(tableView:UITableView,didSelectRowAtIndexPathindex

ios - 在 Swift 中点击时展开单元格

我一直在尝试在我的应用程序中实现一项功能,以便当用户点击我的表格View中的单元格时,该单元格会向下扩展以显示注释。我在Objective-C中找到了很多这样的例子,但我还没有找到Swift的例子。这个例子看起来很完美:Accordiontablecell-Howtodynamicallyexpand/contractuitableviewcell?我曾尝试将它翻译成Swift:varselectedRowIndex=NSIndexPath()overridefunctableView(tableView:UITableView,didSelectRowAtIndexPathindex

swift - editActionsForRowAtIndexPath 不在带有 Xcode 7 的 iOS 8 上执行

我正在3台设备上测试我的应用程序。iOS9上有2台设备,iOS8上有一台设备。在iOS9上,函数editActionsForRowAtIndexPath正在运行,当我滑动一个单元格时会显示操作。但在iOS8上,我无法滑动单元格。这是我的代码:functableView(tableView:UITableView,editActionsForRowAtIndexPathindexPath:NSIndexPath)->[UITableViewRowAction]?{letShareAction=UITableViewRowAction(style:.Normal,title:"Partag

swift - editActionsForRowAtIndexPath 不在带有 Xcode 7 的 iOS 8 上执行

我正在3台设备上测试我的应用程序。iOS9上有2台设备,iOS8上有一台设备。在iOS9上,函数editActionsForRowAtIndexPath正在运行,当我滑动一个单元格时会显示操作。但在iOS8上,我无法滑动单元格。这是我的代码:functableView(tableView:UITableView,editActionsForRowAtIndexPathindexPath:NSIndexPath)->[UITableViewRowAction]?{letShareAction=UITableViewRowAction(style:.Normal,title:"Partag

ios - didSelectRowAtIndexPath 不起作用,Swift 3

谁能明白为什么didSelectRowAtIndexPath不会被调用?delegate在代码和Storyboard中对我进行了三重检查。classAddCard:UIViewController,UIPopoverPresentationControllerDelegate,UITableViewDataSource,UITableViewDelegate{@IBOutletweakvarcardView:UIView!@IBOutletweakvartableView:UITableView!lettableItems=["BackgroundColor","BackgroundI

ios - didSelectRowAtIndexPath 不起作用,Swift 3

谁能明白为什么didSelectRowAtIndexPath不会被调用?delegate在代码和Storyboard中对我进行了三重检查。classAddCard:UIViewController,UIPopoverPresentationControllerDelegate,UITableViewDataSource,UITableViewDelegate{@IBOutletweakvarcardView:UIView!@IBOutletweakvartableView:UITableView!lettableItems=["BackgroundColor","BackgroundI

ios - 自动滚动到具有特定值的单元格

我在这样的TableView中有一个数字列表。如您所见,数字是重复的。让我们将一组重复的数字视为一个组。所以有1组、2组等等。我想做的是当应用程序启动时,我需要自动滚动到指定组的开始位置。在进一步解释之前,这是我到目前为止的代码。importUIKitclassTableViewController:UITableViewController,UITableViewDataSource,UITableViewDelegate{privatevarscrollToTime=trueprivatevaritems=[Int]()privatevargroupNoToScroll=12ove