iOS實現3D卡片式輪播效果
阿新 • • 發佈:2020-02-22
本文例項為大家分享了iOS實現3D卡片式輪播效果的具體程式碼,供大家參考,具體內容如下
效果:
參考UITableView的UITableViewDataSource和UITableViewDelegate兩個方法實現;支援五險輪播,可以載入本地圖片,也可以載入網路圖片,可以根據自己的需求自定義
Demo地址
UITableViewDelegate
/** * 當前顯示cell的Size(中間頁顯示大小) * * @param flowView <#flowView description#> * * @return <#return value description#> */ - (CGSize)sizeForPageInFlowView:(HQFlowView *)flowView; /** * 滾動到了某一列 * * @param pageNumber <#pageNumber description#> * @param flowView <#flowView description#> */ - (void)didScrollToPage:(NSInteger)pageNumber inFlowView:(HQFlowView *)flowView; /** * 點選了第幾個cell * * @param subView 點選的控制元件 * @param subIndex 點選控制元件的index * * @return <#return value description#> */ - (void)didSelectCell:(HQIndexBannerSubview *)subView withSubViewIndex:(NSInteger)subIndex;
UITableViewDataSource
/** * 返回顯示View的個數 * * @param flowView <#flowView description#> * * @return <#return value description#> */ - (NSInteger)numberOfPagesInFlowView:(HQFlowView *)flowView; /** * 給某一列設定屬性 * * @param flowView <#flowView description#> * @param index <#index description#> * * @return <#return value description#> */ - (HQIndexBannerSubview *)flowView:(HQFlowView *)flowView cellForPageAtIndex:(NSInteger)index;
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支援我們。