Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
正如我们所知,UITableViewCell有一个属性selectedBackgroundView可以让我们向它添加选定的背景视图。但现在我正在使用iCarousel库并想将选定的背景视图添加到它的单元格中。我该怎么做?
UITableViewCell
selectedBackgroundView
iCarousel
您提供轮播显示的视图,以便您可以添加任意数量的视图。IndeedUITableViewCell是一种视图,因此您可以根据需要使用该视图的实例。
您可以使用subviews获取 iCarousel 视图的子视图。然后就可以isKindOfClass用来判断是否是cell view了。如果是这样,您可以直接为其设置背景颜色。
subviews
isKindOfClass