草庐IT

IndexPath

全部标签

swift - 如何在 Tableview 中的 Collectionview 中使用 pageControl?

在我的项目中,我在collectionView中使用了tableView,还使用了pageControl。当我水平滑动CollectionView时,我也想切换pageControl,但它不能正常工作。我使用scrollViewDidScroll方法将pageControl切换为collectionView滑动。但问题是,当tableView滚动时,scrollViewDidScroll方法会再次调用。那么是否有任何不同的方法或任何解决方案来解决这个问题。检查以下链接。enterlinkdescriptionhereTableView方法functableView(_tableView

Swift:如何在不重新加载数据的情况下重新加载 UITableViewCell 中的行高

我有一个案例,我必须只重新加载UITableViewCell的高度。但是如果我调用这个函数tableView.reloadRowsAtIndexPaths([NSIndexPath(forRow:webView.tag,inSection:0)],withRowAnimation:.Automatic)它重新加载单元格的高度和数据。我怎样才能在Swift中控制单元格的高度?这是我的cellForRowblock:overridefunctableView(tableView:UITableView,cellForRowAtIndexPathindexPath:NSIndexPath)-

Swift:如何在不重新加载数据的情况下重新加载 UITableViewCell 中的行高

我有一个案例,我必须只重新加载UITableViewCell的高度。但是如果我调用这个函数tableView.reloadRowsAtIndexPaths([NSIndexPath(forRow:webView.tag,inSection:0)],withRowAnimation:.Automatic)它重新加载单元格的高度和数据。我怎样才能在Swift中控制单元格的高度?这是我的cellForRowblock:overridefunctableView(tableView:UITableView,cellForRowAtIndexPathindexPath:NSIndexPath)-

ios - 将多个参数传递给 addTarget

在我的UITableViewCell中,我有一个按钮。我想通过在cellForRowAtIndexPath方法中传递多个参数来向它添加操作。functableView(tableView:UITableView,cellForRowAtIndexPathindexPath:NSIndexPath)->UITableViewCell{letcell=tableView.dequeueReusableCellWithIdentifier("CartCell",forIndexPath:indexPath)as!CartTableViewCellcell.buyButton.addTarge

ios - 将多个参数传递给 addTarget

在我的UITableViewCell中,我有一个按钮。我想通过在cellForRowAtIndexPath方法中传递多个参数来向它添加操作。functableView(tableView:UITableView,cellForRowAtIndexPathindexPath:NSIndexPath)->UITableViewCell{letcell=tableView.dequeueReusableCellWithIdentifier("CartCell",forIndexPath:indexPath)as!CartTableViewCellcell.buyButton.addTarge

ios - 滚动 UITableView 时的值变化

我有一个带有按钮的UITableView,该按钮根据用户是否“收藏”帖子进行切换。一切正常,除了滚动表格View时,按钮会发生变化。这是我的代码:functableView(tableView:UITableView,numberOfRowsInSectionsection:Int)->Int{guardletfeed=self.feedelse{return0}returnfeed.count}functableView(tableView:UITableView,cellForRowAtIndexPathindexPath:NSIndexPath)->UITableViewCell

ios - 滚动 UITableView 时的值变化

我有一个带有按钮的UITableView,该按钮根据用户是否“收藏”帖子进行切换。一切正常,除了滚动表格View时,按钮会发生变化。这是我的代码:functableView(tableView:UITableView,numberOfRowsInSectionsection:Int)->Int{guardletfeed=self.feedelse{return0}returnfeed.count}functableView(tableView:UITableView,cellForRowAtIndexPathindexPath:NSIndexPath)->UITableViewCell

ios - 在 Swift 中获取可见的 IndexPath UICollectionView

如何在collectionView中滚动时获取可见的IndexPath,我引用了很多link1,link2但是Swift不支持indexPathForCell。 最佳答案 你试过委托(delegate)功能吗?publicfuncindexPathsForVisibleItems()->[NSIndexPath]或collectionView.indexPathsForVisibleItems()这些一定能满足您的需求。 关于ios-在Swift中获取可见的IndexPathUIColl

ios - 在 Swift 中获取可见的 IndexPath UICollectionView

如何在collectionView中滚动时获取可见的IndexPath,我引用了很多link1,link2但是Swift不支持indexPathForCell。 最佳答案 你试过委托(delegate)功能吗?publicfuncindexPathsForVisibleItems()->[NSIndexPath]或collectionView.indexPathsForVisibleItems()这些一定能满足您的需求。 关于ios-在Swift中获取可见的IndexPathUIColl

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