- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我在 swift 1.2 中收到以下错误:'RootViewController' does not conform to protocol 'iCarouselDataSource'
在下面的类中,当我尝试实现第三方库 iCarousel 时:
class RootViewController: UIViewController,iCarouselDataSource,iCarouselDelegate
{...}
自动修复工具在此方法中放置一个符合协议(protocol)的@objc 标记:
@objc func carousel(carousel: iCarousel!, viewForItemAtIndex index: Int, var reusingView view: UIView?) -> UIView?
{}
但随后出现另一个错误:Method cannot be marked @objc because the type of the parameter 3 cannot be represented in Objective-C
感谢任何帮助或线索,谢谢!
最佳答案
从 reusingView 中删除 var,例如:
func carousel(carousel: iCarousel!, viewForItemAtIndex index: Int, reusingView view: UIView!) -> UIView! {
var newView = view
if newView == nil {
//create new view
}
//update data
return newView
}
关于objective-c - iCarousel in swift version 1.2 报错(candidate is not Objc but protocol requires it),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29611324/
我在我的应用程序中使用 iCarousel,我需要获取 iCarousel 的当前索引并将该索引显示在标签(self.view 的 subview )中,该标签不是 iCarousel 的 subvi
我正在使用 iCarousel 来滚动图像。代码是: - (CATransform3D)carousel:(iCarousel *)_carousel itemTransformForOffset:(
我使用 iCarousel 库在我的屏幕上滚动许多 UIView。每个 View 填满整个屏幕。 我需要以某种方式配置 iCarousel,以便通过短触仅滚动一个 View 。 我现在有 carous
我正在使用 iCarousel 滚动标签。在模拟器上一切正常,但在 iPad/iPhone 上滚动并不顺畅和快速 这是代码。 城市 ListView .h #import #import "iCar
我正在使用 iCarousel framework . https://github.com/nicklockwood/iCarousel 在那里我想找出 View 的滑动方向 ,因为我有下一个和上一
我正在使用NickLockwood的iCarousel。我不明白为什么不调用viewForItemAtIndex(设置断点且未命中)一切都已正确完成。datasource和delegate设置为sel
我想获取用户点击的索引。我尝试了多种方法来检测它,但都不起作用。这是我尝试过的。 func carousel(carousel: iCarousel, didSelectItemAtIndex
我正在尝试创建一个“上传图像”系统,并且我正在尝试调整每个图像之间的空间。然而,它并没有按计划进行,因为当轮播停止移动时,由于重叠,图像总是必须移到前面。我怎样才能阻止这种重叠?谢谢! func ca
我在 CollectionView 中使用 iCarousel 模块。轮播 View 位于我的 UICollectionViewCell 中。 我的代码如下。 class CelebrityDetai
我开始使用 iCarousel 但出现了这个错误: Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
我在我的应用程序中使用了很棒的 iCarousel 库。但我面临一个问题。我正在使用此代码将数据填充到轮播中。 - (NSUInteger)numberOfItemsInCarousel:(iCaro
如何确定轮播的索引?或者加载到其中的数组索引?我已经从 NSDocumentDirectory 加载了图像。 self.myImages = [NSMutableArray new]; for(in
我已经在我的应用程序中实现了 iCarousel。我想让 iCarousel 通过用户迭代仅向一个方向滚动。 我的场景是一个 View 列表,用户只能通过回答当前 View 上的问题来转到下一个 Vi
我有一个 iCarousel,它包含一些位于屏幕底部下方的元素(即它们可以滚动到)。 我正在执行一个动画,其中将 CGAffineTransformMakeScale 应用于该 UIScrollVie
所以我尝试使用 iCarousel 以图像形式显示产品,然后用户可以简单地滚动并查看所有可用的产品。 出于某种原因,当您加载 viewcontroller 时,它根本不显示任何图像,甚至不显示轮播,它
我已经以编程方式设置了按钮,如下所示:- -(UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSInteger)index r
我在我的 CoverFlow 应用中实现了 iCarousel。我找不到检测方法,现在显示的是哪个 View 。 有人知道吗?谢谢。 最佳答案 根据documentation ,您可以使用属性 cur
如何在特定项目或索引中滚动,例如:我在另一个 UIView 上设置了一个 NSInteger,然后将它传递给我的 iCarousel .在我的另一个 UIView 中,我这样设置 NSInteger:
我已经实现了 iCarousel 的这个方法, 开始时它会卡住,几秒钟后它允许我滚动。而且我不希望图像在滚动时重叠,我希望它们在每个项目之间都具有相等的距离。 这段代码有什么问题?或者我遗漏了什么?
我正在尝试使用以下代码将 iCarousel 添加到现有项目,但出现此错误:MemberCatalog[14990:1a903] -[MainViewController carousel:viewF
我是一名优秀的程序员,十分优秀!