【问题标题】:How to find particular index in icarousel ios?如何在icarousel ios中找到特定索引?
【发布时间】:2014-02-20 13:59:50
【问题描述】:

我使用iCarousel 和一些项目(等于数组计数)从 1 月到 12 月在其中带有标签。
怎么办,如果我必须找到 December 元素的索引并自动滚动到该特定索引。

对于自动滚动,我找到了 1 种方法

[_carousel scrollToItemAtIndex:(NSInteger*) animated:(BOOL)];
如何找到具有十二月标签的项目的索引?提前谢谢。

【问题讨论】:

    标签: ios icarousel


    【解决方案1】:

    获取数组中对象的索引,它将匹配轮播中视图的索引。如果您的数组包含字符串,那么您可以通过说得到 12 月的索引

     NSInteger index = [array indexOfObject:@"December"];
    

    【讨论】:

      猜你喜欢
      • 2021-12-26
      • 2023-04-03
      • 2021-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多