仿淘寶垛叨、京東熱門(mén)Banner

仿淘寶、京東柜某、美團(tuán)等主流App等主流菜單輪播圖嗽元、Banner

一敛纲、封裝熱門(mén)滾動(dòng)菜單,已經(jīng)支持pod下載 还棱,請(qǐng)更新pod版本庫(kù)

  • 最新版本:0.0.6
  • OC版本:
    - pod搜索:pod search CGXHotBrandViewOC
    - 如果搜不到去請(qǐng)搜索:pod search CGXHotBrandViewOC --simple
  • 詳情 CGXHotBrandViewOC庫(kù)

二载慈、效果圖

hotBrand1.gif

hotBrand2.gif

hotBrand3.gif

hotBrand4.gif

hotBrand5.gif

hotBrand6.gif

hotBrand7.gif

hotBrand8.gif

hotBrand9.gif

hotBrand10.gif

三、使用說(shuō)明

  • 1珍手、初始化CGXHotBrandView
        CGXHotBrandView *hotBrandView = [[CGXHotBrandView alloc] init];
        hotBrandView.delegate = self;
        hotBrandView.dataSource =self;
        hotBrandView.minimumLineSpacing = 5;
        hotBrandView.minimumInteritemSpacing = 5;
        hotBrandView.edgeInsets = UIEdgeInsetsMake(5, 5, 5, 5);
        hotBrandView.itemSectionCount = 2;
        hotBrandView.itemRowCount = 5;
        if (i==0) {
            hotBrandView.pagingEnabled = YES;
            hotBrandView.itemSectionCount = 2;
            hotBrandView.itemRowCount = 5;
        } else if(i==1){
            hotBrandView.pagingEnabled = YES;
            hotBrandView.itemSectionCount = 2;
            hotBrandView.itemRowCount = 6;
        }else{
            hotBrandView.pagingEnabled = NO;
        }
        hotBrandView.bounces = YES;
        //        hotBrandView.isHavePage = NO;
        CGFloat height = (ScreenHeight-kTabBarHeight-kTopHeight-40)/3.0;
        hotBrandView.frame = CGRectMake(0, 10*(i+1) + i*height,ScreenWidth,height);
        hotBrandView.backgroundColor = [UIColor colorWithWhite:0.93 alpha:1];
        [self.view addSubview:hotBrandView];
        hotBrandView.pageHeight = 10;
        hotBrandView.tag = 10000+i;
        hotBrandView.showType = i+1;
        hotBrandView.isAnimation = i==1 ? NO:YES;
        
  • 2.配置CGXHotBrandView數(shù)據(jù)的屬性
NSMutableArray *dataArray = [NSMutableArray array];
        for (int j = 0; j< 4; j++) {
            NSMutableArray *rowArray = [NSMutableArray array];
            for (int k = 0; k< hotBrandView.itemSectionCount*hotBrandView.itemRowCount; k++) {
                CGXHotBrandModel *model = [[CGXHotBrandModel alloc] init];
                model.titleStr = [NSString stringWithFormat:@"貓咪%d-%d",j,k];
                model.itemColor = [UIColor whiteColor];
                model.hotPicStr = imageArray[arc4random() % (imageArray.count)];
                model.tagStr = (arc4random() % 2 == 0) ? @"秒殺":@"";
                model.tagSpace = 10;
                [rowArray addObject:model];
            }
            [dataArray addObject:rowArray];
        }
        [hotBrandView updateWithDataArray:dataArray];
  • 3.可選實(shí)現(xiàn)CGXHotBrandCustomViewDelegate代理
// ========== 輪播自定義cell ==========
/** 如果你需要自定義cell樣式办铡,請(qǐng)?jiān)趯?shí)現(xiàn)此代理方法返回你的自定義cell的class。 */
- (Class)gx_hotBrandCellClassForBaseView:(CGXHotBrandBaseView *)hotView;
/** 如果你需要自定義cell樣式琳要,請(qǐng)?jiān)趯?shí)現(xiàn)此代理方法返回你的自定義cell的Nib寡具。 */
- (UINib *)gx_hotBrandCellNibForBaseView:(CGXHotBrandBaseView *)hotView;
  • 4.可選實(shí)現(xiàn)CGXHotBrandViewDataSource代理
/* : 輪播自定義cell 如果設(shè)置多個(gè)當(dāng)根據(jù)tag值判斷時(shí), 先設(shè)置tag再設(shè)置delegate */
/** 如果你需要自定義cell樣式稚补,請(qǐng)?jiān)趯?shí)現(xiàn)此代理方法返回你的自定義cell的class童叠。 */
- (Class)gx_hotBrandCellClassForBaseView:(CGXHotBrandBaseView *)hotView;
/** 如果你需要自定義cell樣式,請(qǐng)?jiān)趯?shí)現(xiàn)此代理方法返回你的自定義cell的Nib课幕。 */
- (UINib *)gx_hotBrandCellNibForBaseView:(CGXHotBrandBaseView *)hotView;
/*點(diǎn)擊cell*/
- (void)gx_hotBrandBaseView:(CGXHotBrandBaseView *)hotView
   didSelectItemAtIndexPath:(NSIndexPath *)indexPath
                    AtModel:(CGXHotBrandModel *)hotModel;
/*滾動(dòng)結(jié)束cell CGXHotBrandCycleView厦坛、CGXHotBrandView無(wú)效  */
- (void)gx_hotBrandBaseView:(CGXHotBrandBaseView *)hotView
      ScrollEndItemAtIndexPath:(NSIndexPath *)indexPath
                    AtModel:(CGXHotBrandModel *)hotModel;
/* cell數(shù)據(jù)交互處理*/
- (void)gx_hotBrandBaseView:(CGXHotBrandBaseView *)hotView
     cellForItemAtIndexPath:(NSIndexPath *)indexPath
                     AtCell:(UICollectionViewCell *)cell
                    AtModel:(CGXHotBrandModel *)hotModel;
/* 正在滾動(dòng) */
- (void)gx_hotBrandBaseView:(CGXHotBrandBaseView *)hotView
              ScrollAtPoint:(UIScrollView *)scrollView;

  • 5.自定義cell實(shí)現(xiàn)CGXHotBrandUpdateCellDelegate代理方法
- (void)updateWithHotBrandCellModel:(CGXHotBrandModel *)cellModel Section:(NSInteger)section Row:(NSInteger)row
  • 6、將不斷更新更多效果 乍惊,敬請(qǐng)期待6沤铡!润绎!
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
禁止轉(zhuǎn)載撬碟,如需轉(zhuǎn)載請(qǐng)通過(guò)簡(jiǎn)信或評(píng)論聯(lián)系作者。
  • 序言:七十年代末莉撇,一起剝皮案震驚了整個(gè)濱河市呢蛤,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌棍郎,老刑警劉巖其障,帶你破解...
    沈念sama閱讀 221,548評(píng)論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異涂佃,居然都是意外死亡静秆,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,497評(píng)論 3 399
  • 文/潘曉璐 我一進(jìn)店門(mén)巡李,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)抚笔,“玉大人,你說(shuō)我怎么就攤上這事侨拦∈獬龋” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 167,990評(píng)論 0 360
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)膨蛮。 經(jīng)常有香客問(wèn)我叠纹,道長(zhǎng),這世上最難降的妖魔是什么敞葛? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 59,618評(píng)論 1 296
  • 正文 為了忘掉前任誉察,我火速辦了婚禮,結(jié)果婚禮上惹谐,老公的妹妹穿的比我還像新娘持偏。我一直安慰自己,他們只是感情好氨肌,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,618評(píng)論 6 397
  • 文/花漫 我一把揭開(kāi)白布鸿秆。 她就那樣靜靜地躺著,像睡著了一般怎囚。 火紅的嫁衣襯著肌膚如雪卿叽。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書(shū)人閱讀 52,246評(píng)論 1 308
  • 那天恳守,我揣著相機(jī)與錄音考婴,去河邊找鬼。 笑死催烘,一個(gè)胖子當(dāng)著我的面吹牛沥阱,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播颗圣,決...
    沈念sama閱讀 40,819評(píng)論 3 421
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼喳钟,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼屁使!你這毒婦竟也來(lái)了在岂?” 一聲冷哼從身側(cè)響起,我...
    開(kāi)封第一講書(shū)人閱讀 39,725評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤蛮寂,失蹤者是張志新(化名)和其女友劉穎蔽午,沒(méi)想到半個(gè)月后,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體酬蹋,經(jīng)...
    沈念sama閱讀 46,268評(píng)論 1 320
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡及老,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,356評(píng)論 3 340
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了范抓。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片骄恶。...
    茶點(diǎn)故事閱讀 40,488評(píng)論 1 352
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖匕垫,靈堂內(nèi)的尸體忽然破棺而出僧鲁,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 36,181評(píng)論 5 350
  • 正文 年R本政府宣布寞秃,位于F島的核電站斟叼,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏春寿。R本人自食惡果不足惜朗涩,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,862評(píng)論 3 333
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望绑改。 院中可真熱鬧谢床,春花似錦、人聲如沸绢淀。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 32,331評(píng)論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)皆的。三九已至覆履,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間费薄,已是汗流浹背硝全。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 33,445評(píng)論 1 272
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留楞抡,地道東北人伟众。 一個(gè)月前我還...
    沈念sama閱讀 48,897評(píng)論 3 376
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像召廷,于是被迫代替她去往敵國(guó)和親凳厢。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,500評(píng)論 2 359

推薦閱讀更多精彩內(nèi)容