日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

iOS-UICollectionView

發布時間:2024/4/13 编程问答 42 豆豆
生活随笔 收集整理的這篇文章主要介紹了 iOS-UICollectionView 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1------------------------------------------------------------------------------------------------------------------------

本章通過先總體介紹UICollectionView及其常用方法,再結合一個實例,了解如何使用UICollectionView。

?

UICollectionView 和 UICollectionViewController 類是iOS6 新引進的API,用于展示集合視圖,布局更加靈活,可實現多列布局,用法類似于UITableView 和 UITableViewController 類。

使用UICollectionView 必須實現UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout這三個協議。

?

下面先給出常用到的一些方法。(只給出常用的,其他的可以查看相關API)?

  • #pragma?mark?--?UICollectionViewDataSource???
  • //定義展示的UICollectionViewCell的個數??
  • -(NSInteger)collectionView:(UICollectionView?*)collectionView?numberOfItemsInSection:(NSInteger)section??
  • {??
  • ????return?30;??
  • } ??
  • //定義展示的Section的個數??
  • -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView?*)collectionView??
  • {??
  • ????return?1;??
  • } ??
  • //每個UICollectionView展示的內容??
  • -(UICollectionViewCell?*)collectionView:(UICollectionView?*)collectionView?cellForItemAtIndexPath:(NSIndexPath?*)indexPath??
  • {??
  • ????static?NSString?*?CellIdentifier?=?@"GradientCell";??
  • ????UICollectionViewCell?*?cell?=?[collectionView?dequeueReusableCellWithReuseIdentifier:CellIdentifier?forIndexPath:indexPath];??
  • ??
  • ????cell.backgroundColor?=?[UIColor?colorWithRed:((10?*?indexPath.row)?/?255.0)?green:((20?*?indexPath.row)/255.0)?blue:((30?*?indexPath.row)/255.0)?alpha:1.0f];??
  • ????return?cell;??
  • } ??
  • #pragma?mark?--UICollectionViewDelegateFlowLayout???
  • //定義每個UICollectionView?的大小??
  • -?(CGSize)collectionView:(UICollectionView?*)collectionView?layout:(UICollectionViewLayout*)collectionViewLayout?sizeForItemAtIndexPath:(NSIndexPath?*)indexPath??
  • {??
  • ????return?CGSizeMake(96,?100);??
  • } ??
  • //定義每個UICollectionView?的?margin??
  • -(UIEdgeInsets)collectionView:(UICollectionView?*)collectionView?layout:(UICollectionViewLayout?*)collectionViewLayout?insetForSectionAtIndex:(NSInteger)section??
  • {??
  • ????return?UIEdgeInsetsMake(5,?5,?5,?5);??
  • } ??
  • #pragma?mark?--UICollectionViewDelegate???
  • //UICollectionView被選中時調用的方法??
  • -(void)collectionView:(UICollectionView?*)collectionView?didSelectItemAtIndexPath:(NSIndexPath?*)indexPath??
  • {??
  • ????UICollectionViewCell?*?cell?=?(UICollectionViewCell?*)[collectionView?cellForItemAtIndexPath:indexPath];??
  • ????cell.backgroundColor?=?[UIColor?whiteColor];??
  • } ??
  • //返回這個UICollectionView是否可以被選擇??
  • -(BOOL)collectionView:(UICollectionView?*)collectionView?shouldSelectItemAtIndexPath:(NSIndexPath?*)indexPath??
  • {??
  • ????return?YES;??
  • }??
  • ?

    ?

    ?

    下面通過一個例子具體介紹下。(例子來自網絡。但是是通過第三方獲得的,無法取得鏈接。還望見諒。)

    ?

    iOS CollectionView的出現是一大福利,再也不用用TableView來定義復雜的多欄表格了,用法與Table類似,只是Cell必須自己添加,無默認模式

    由于CollectionView沒有默認的Cell布局,所以一般還是自定義方便又快捷

    一、自定義Cell

    1、新建類CollectionCell繼承自UICollectionViewCell

    2、新建Xib,命名為CollectionCell.xib

    a.選中CollectionCell.xib刪掉默認的View,從控件中拖一個Collection View Cell(圖3)到畫布中,設置大小為95*116;

    ?

    b.選中剛剛添加的Cell,更改類名為CollectionCell,如圖4

    c.在CollectionCell.xib的CollectionCell中添加一個ImageView和一個Label(圖5)

    d.創建映射, 圖6,圖7

    e.選中CollectionCell.m , 重寫init方法?

  • -?(id)initWithFrame:(CGRect)frame??
  • {??
  • ????self?=?[super?initWithFrame:frame];??
  • ????if?(self)??
  • ????{??
  • ????????//?初始化時加載collectionCell.xib文件??
  • ????????NSArray?*arrayOfViews?=?[[NSBundle?mainBundle]?loadNibNamed:@"CollectionCell"?owner:self?options:nil];??
  • ??????????
  • ????????//?如果路徑不存在,return?nil??
  • ????????if?(arrayOfViews.count?<?1)??
  • ????????{??
  • ????????????return?nil;??
  • ????????}??
  • ????????//?如果xib中view不屬于UICollectionViewCell類,return?nil??
  • ????????if?(![[arrayOfViews?objectAtIndex:0]?isKindOfClass:[UICollectionViewCell?class]])??
  • ????????{??
  • ????????????return?nil;??
  • ????????}??
  • ????????//?加載nib??
  • ????????self?=?[arrayOfViews?objectAtIndex:0];??
  • ????}??
  • ????return?self;??
  • }??

  • f.選中CollectionCell.xib 修改其identifier為CollectionCell。


    二、定義UICollectionView;

    1、拖動一個Collection View到指定ViewController的View上

    2、連線dataSource和delegate,并創建映射,命名為CollectionView

    3、選中CollectionView的標尺,將Cell Size的Width和Height改成與自定義的Cell一樣的95*116,圖8

    ? ??

    4、選中CollectionView的屬性,可以修改其屬性,比如是垂直滑動,還是水平滑動,選擇Vertical或Horizontal

    5、選中CollectionViewCell,修改Class,繼承自CollectionCell

    5、在ViewDidLoad方法中聲明Cell的類,在ViewDidLoad方法中添加,此句不聲明,將無法加載,程序崩潰

    其中,CollectionCell是這個Cell的標識(之前幾步已經定義過了。 )?

  • [self.collectionView?registerClass:[CollectionCell?class]?forCellWithReuseIdentifier:@"CollectionCell"];??

  • 6、在ViewController.h中聲明代理?

  • @interface?ViewController?:?UIViewController<UICollectionViewDataSource,UICollectionViewDelegate>??


  • ?

    7、在.m文件中實現代理方法?

  • //每個section的item個數??
  • -(NSInteger)collectionView:(UICollectionView?*)collectionView?numberOfItemsInSection:(NSInteger)section??
  • {??
  • ????return?12;??
  • }??
  • ??
  • -(UICollectionViewCell?*)collectionView:(UICollectionView?*)collectionView?cellForItemAtIndexPath:(NSIndexPath?*)indexPath??
  • {??
  • ??????
  • ????CollectionCell?*cell?=?(CollectionCell?*)[collectionView?dequeueReusableCellWithReuseIdentifier:@"CollectionCell"?forIndexPath:indexPath];??
  • ??????
  • ????//圖片名稱??
  • ????NSString?*imageToLoad?=?[NSString?stringWithFormat:@"%d.png",?indexPath.row];??
  • ????//加載圖片??
  • ????cell.imageView.image?=?[UIImage?imageNamed:imageToLoad];??
  • ????//設置label文字??
  • ????cell.label.text?=?[NSString?stringWithFormat:@"{%ld,%ld}",(long)indexPath.row,(long)indexPath.section];??
  • ??????
  • ????return?cell;??
  • }??


  • ?

    8 。效果如圖10

    點擊某項后跳轉事件與UITableView類似,實現代理方法?

  • -(void)collectionView:(UICollectionView?*)collectionView?didSelectItemAtIndexPath:(NSIndexPath?*)indexPath ?
  • ------------------------------------------------------------------------------------------------------------------------------------ 2

    UICollectionView基礎

    初始化部分:

    UICollectionViewFlowLayout *flowLayout= [[UICollectionViewFlowLayout alloc]init]; self.myCollectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(20, 20, 250, 350) collectionViewLayout:flowLayout]; self.myCollectionView.backgroundColor = [UIColor grayColor]; [self.myCollectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@“myCell"]; self.myCollectionView.delegate = self; self.myCollectionView.dataSource = self;[self.view addSubview:self.myCollectionView];

    ?

    UICollectionViewLayout

    UICollectionViewLayout決定了UICollectionView如何顯示在界面上,Apple提供了一個最簡單的默認layout對象:UICollectionViewFlowLayout。

    Flow Layout是一個Cells的線性布局方案,并具有頁面和頁腳。其可定制的內容如下:

    itemSize屬性

    設定全局的Cell尺寸,如果想要單獨定義某個Cell的尺寸,可以使用下面方法:

    -?(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath

    minimumLineSpacing屬性

    設定全局的行間距,如果想要設定指定區內Cell的最小行距,可以使用下面方法:

    -?(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section

    minimumInteritemSpacing屬性

    設定全局的Cell間距,如果想要設定指定區內Cell的最小間距,可以使用下面方法:

    - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section;

    scrollDirection屬性

    設定滾動方向,有UICollectionViewScrollDirectionVerticalUICollectionViewScrollDirectionHorizontal兩個值。

    headerReferenceSize屬性與footerReferenceSize屬性

    設定頁眉和頁腳的全局尺寸,需要注意的是,根據滾動方向不同,header和footer的width和height中只有一個會起作用。如果要單獨設置指定區內的頁面和頁腳尺寸,可以使用下面方法:

    -?(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section

    -?(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section

    sectionInset屬性

    設定全局的區內邊距,如果想要設定指定區的內邊距,可以使用下面方法:

    - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section;


    ?

    然后需要實現三種類型的委托:UICollectionViewDataSource, UICollectionViewDelagate和UICollectionViewDelegateFlowLayout

    @interface ViewController : UIViewController <UICollectionViewDelegateFlowLayout, UICollectionViewDataSource>

    因為UICollectionViewDelegateFlowLayout實際上是UICollectionViewDelegate的一個子協議,它繼承了UICollectionViewDelegate,所以只需要在聲明處寫上UICollectionViewDelegateFlowLayout就行了。


    ?

    UICollectionViewDataSource

    -?(NSInteger)numberOfSectionsInCollectionView:(UICollectionView?*)collectionView

    返回collection view里區(section)的個數,如果沒有實現該方法,將默認返回1:

    - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {return 2; }

    ?

    -?(NSInteger)collectionView:(UICollectionView?*)collectionView numberOfItemsInSection:(NSInteger)section

    返回指定區(section)包含的數據源條目數(number of items),該方法必須實現:

    - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {return 7; }

    ?

    -?(UICollectionViewCell?*)collectionView:(UICollectionView?*)collectionView cellForItemAtIndexPath:(NSIndexPath?*)indexPath

    返回某個indexPath對應的cell,該方法必須實現:

    - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"myCell" forIndexPath:indexPath];if(indexPath.section==0){cell.backgroundColor = [UIColor redColor];}else if(indexPath.section==1){cell.backgroundColor = [UIColor greenColor];}return cell; }

    UICollectionViewCell結構上相對比較簡單,由下至上:

    • 首先是cell本身作為容器view
    • 然后是一個大小自動適應整個cell的backgroundView,用作cell平時的背景
    • 再其次是selectedBackgroundView,是cell被選中時的背景
    • 最后是一個contentView,自定義內容應被加在這個view

    ?

    -?(UICollectionReusableView?*)collectionView:(UICollectionView?*)collectionView viewForSupplementaryElementOfKind:(NSString*)kind atIndexPath:(NSIndexPath?*)indexPath

    為collection view添加一個補充視圖(頁眉或頁腳)

    ?

    -?(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section

    設定頁眉的尺寸

    ?

    -?(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section

    設定頁腳的尺寸

    ?

    -?(void)registerClass:(Class)viewClass forSupplementaryViewOfKind:(NSString?*)elementKind withReuseIdentifier:(NSString*)identifier

    添加頁眉和頁腳以前需要注冊類和標識:


    ?

    添加補充視圖的代碼示例:

    [self.myCollectionView registerClass:[MyHeadView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"hxwHeader"]; [self.myCollectionView registerClass:[MyHeadView class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"hxwHeader"];-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section {CGSize size = {240,25};return size; }-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section {CGSize size = {240,25};return size; }- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {MyHeadView *headView;if([kind isEqual:UICollectionElementKindSectionHeader]){headView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"hxwHeader" forIndexPath:indexPath];[headView setLabelText:[NSString stringWithFormat:@"section %d's header",indexPath.section]];}else if([kind isEqual:UICollectionElementKindSectionFooter]){headView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"hxwHeader" forIndexPath:indexPath];[headView setLabelText:[NSString stringWithFormat:@"section %d's footer",indexPath.section]];}return headView; }

    ?

    MyHeadView.h

    #import <UIKit/UIKit.h>@interface MyHeadView : UICollectionReusableView - (void) setLabelText:(NSString *)text; @end

    ?

    MyHeadView.m

    #import "MyHeadView.h"@interface MyHeadView()@property (strong, nonatomic) UILabel *label;@end@implementation MyHeadView- (id)initWithFrame:(CGRect)frame {self = [super initWithFrame:frame];if (self){self.label = [[UILabel alloc] init];self.label.font = [UIFont systemFontOfSize:18];[self addSubview:self.label];}return self; }- (void) setLabelText:(NSString *)text {self.label.text = text;[self.label sizeToFit]; }@end

    ?

    在注冊Cell和補充視圖時,也可以用新建xib文件的方式:

    [self.myCollectionView registerNib:[UINib nibWithNibName:@"MyCollectionCell" bundle:nil] forCellWithReuseIdentifier:@"hxwCell"];[self.myCollectionView registerNib:[UINib nibWithNibName:@"MySupplementaryView" bundle:nil] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"hxwHeader"];[self.myCollectionView registerNib:[UINib nibWithNibName:@"MySupplementaryView" bundle:nil] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"hxwFooter"];

    用這種方式注冊后,甚至可以不用新建類去綁定這個xib,直接通過viewWithTag的方式獲取xib里的控件:

    UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind :kind withReuseIdentifier:@"hxwHeader" forIndexPath:indexPath];UILabel *label = (UILabel *)[view viewWithTag:1];label.text = @"empty";

    ?


    ?

    UICollectionViewDelegateFlowLayout

    -?(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath

    設定指定Cell的尺寸

    - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {if(indexPath.section==0 && indexPath.row==1){return CGSizeMake(50, 50);}else{return CGSizeMake(75, 30);} }

    ?

    - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section;

    設定collectionView(指定區)的邊距

    - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {if(section==0){return UIEdgeInsetsMake(35, 25, 15, 25);}else{return UIEdgeInsetsMake(15, 15, 15, 15);} }

    ?

    -?(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section

    設定指定區內Cell的最小行距,也可以直接設置UICollectionViewFlowLayout的minimumLineSpacing屬性

    - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {if(section==0){return 10.0;}else{return 20.0;} }

    ?

    - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section;

    設定指定區內Cell的最小間距,也可以直接設置UICollectionViewFlowLayoutminimumInteritemSpacing屬性

    - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {if(section==0){return 10.0;}else{return 20.0;} }

    ?


    UICollectionViewDelegate

    -?(void)collectionView:(UICollectionView?*)collectionView didSelectItemAtIndexPath:(NSIndexPath?*)indexPath

    當指定indexPath處的item被選擇時觸發

    - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { [self.myArray removeObjectAtIndex:indexPath.row];[collectionView deleteItemsAtIndexPaths:[NSArray arrayWithObject:indexPath]]; }

    P.s. 當你刪除或添加元素時,一定要更新numberOfItemsInSection的返回情況。

    ?

    -?(void)collectionView:(UICollectionView?*)collectionView didDeselectItemAtIndexPath:(NSIndexPath?*)indexPath

    當指定indexPath處的item被取消選擇時觸發,僅在允許多選時被調用

    ?

    下面是三個和高亮有關的方法:

    -?(BOOL)collectionView:(UICollectionView?*)collectionView shouldHighlightItemAtIndexPath:(NSIndexPath?*)indexPath

    -?(void)collectionView:(UICollectionView?*)collectionView didHighlightItemAtIndexPath:(NSIndexPath?*)indexPath

    -?(void)collectionView:(UICollectionView?*)collectionView didUnhighlightItemAtIndexPath:(NSIndexPath?*)indexPath

    ?

    事件的處理順序如下:

  • 手指按下
  • shouldHighlightItemAtIndexPath (如果返回YES則向下執行,否則執行到這里為止)
  • didHighlightItemAtIndexPath (高亮)
  • 手指松開
  • didUnhighlightItemAtIndexPath (取消高亮)
  • shouldSelectItemAtIndexPath (如果返回YES則向下執行,否則執行到這里為止)
  • didSelectItemAtIndexPath (執行選擇事件)
  • 如果只是簡單實現點擊后cell改變顯示狀態,只需要在cellForItemAtIndexPath方法里返回cell時,指定cell的selectedBackgroundView:

    - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"myCell" forIndexPath:indexPath];UIView* selectedBGView = [[UIView alloc] initWithFrame:cell.bounds];selectedBGView.backgroundColor = [UIColor blueColor];cell.selectedBackgroundView = selectedBGView;return cell; }

    如果要實現點擊時(手指未松開)的顯示狀態與點擊后(手指松開)的顯示狀態,則需要通過上面提到的方法來實現:

    - (BOOL)collectionView:(UICollectionView *)collectionView shouldHighlightItemAtIndexPath:(NSIndexPath *)indexPath {return YES; }- (void)collectionView:(UICollectionView *)colView didHighlightItemAtIndexPath:(NSIndexPath *)indexPath {UICollectionViewCell* cell = [colView cellForItemAtIndexPath:indexPath];[cell setBackgroundColor:[UIColor purpleColor]]; }- (void)collectionView:(UICollectionView *)colView didUnhighlightItemAtIndexPath:(NSIndexPath *)indexPath {UICollectionViewCell* cell = [colView cellForItemAtIndexPath:indexPath];[cell setBackgroundColor:[UIColor yellowColor]]; }
    -------------------------------------------------------------------------------------------------------------
    3

    iOS UICollectionView的實現

    ios的UICollectionView并不能在iOS6之前的版本中使用,為了兼容之前的版本需要自定義UICollectionView。寫完之后發現人家已經有開源了,下過來看了看發現我是用UIScrollerView的委托真是多此一舉,完全可以用layout來實現嘛。我在判斷重用的時候用了一大堆if沒有別人寫的簡潔明了。 首先是定義委托,需要用戶傳入collection總item的總數與每一行中item的個數。其余的與UITableView的委托基本一致。 isNeedRefreshOrMore方法用來判斷用戶使用需要下拉刷新上拉更多的功能,返回YES就使用。 doCollectionRefresh即為響應下拉刷新事件。更多同樣。。 1 #pragma mark -2 #pragma mark 委托3 @protocol CustomCollectionDataSource<NSObject>4 @required5 //item的總個數6 -(NSInteger)numberOfItemsInCollection;7 //每一行的個數8 -(NSInteger)numberOfItemsInRow;9 @end 10 11 @protocol CustomCollectionDelegate<NSObject> 12 @required 13 -(CustomCollectionItem *)itemInCollectionAtPoint:(CGPoint)point collectionView:(CustomCollectionView *)collection; 14 @optional 15 -(void)itemDidSelectedAtPoint:(CGPoint)point; 16 -(BOOL)isNeedRefreshOrMore; 17 -(void)doCollectionRefresh; 18 -(void)doCollectionMore; 19 20 -(UIView *)collectionViewForHeader; 21 @end 在同文件中定義了頁面狀態的枚舉,用來區分Collcetion的狀態。同時定義了一些public方法 #import <UIKit/UIKit.h>typedef enum {CS_Init,CS_More,CS_Refresh }CollectionState;@class CustomCollectionItem; @protocol CustomCollectionDataSource; @protocol CustomCollectionDelegate;@interface CustomCollectionView : UIScrollView<UIScrollViewDelegate> @property (weak, nonatomic) id<CustomCollectionDataSource> dataSource; @property (weak, nonatomic) id<CustomCollectionDelegate> customDelegate;-(CustomCollectionItem *)dequeueReusableItemWithIdentifier:(NSString *)identifier; -(void)addItemsIntoDic; -(void)itemClickedAtPoint:(CGPoint)point; -(void)reloadData; -(CustomCollectionItem *)getItemAtPoint:(CGPoint)point;@property (strong,nonatomic) UIView *headerView; @end #import "CustomCollectionView.h" #import "CustomCollectionItem.h" #import "BaseRMView.h" @interface CustomCollectionView()
    //重用池--原諒這個名字 @property (strong, nonatomic) NSMutableDictionary *contentItemDictionary;
    //能夠顯示的item數量(以行計) @property(assign,nonatomic) NSInteger showCount; @property (assign,nonatomic) NSInteger offRowIndex;
    //分割線--沒有用到 默認成了10px @property (assign,nonatomic) CGFloat itemSpliteWidth;
    //總行數 @property (assign,nonatomic) NSInteger rows; //item個數 @property (assign, nonatomic) NSInteger numberOfItemsInCollection;
    //每行item個數 @property (assign,nonatomic) NSInteger numberOfItemsInRow;
    //每一行的高度 @property (assign, nonatomic) CGFloat heightOfRow; // @property (assign, nonatomic) CGRect viewFrame; //是否第一次加載 @property (assign,nonatomic) BOOL isFirstLoad;
    //上一次scrollview的offsetY,用來判斷是向上滑動還是向下滑動 @property (assign,nonatomic) CGFloat lastOffsetY;
    //當前最后一行的index,從0開始 @property (assign,nonatomic) NSInteger lastRowIndex;
    //當前最上一行的index,從0開始 @property (assign,nonatomic) NSInteger topRowIndex; //沒用 @property (assign,nonatomic) NSInteger numberOfMore; //是否需要顯示刷新更多頁面標志 @property (assign,nonatomic) BOOL isNeedShowMoreTag;
    //刷新view @property (strong,nonatomic) BaseRMView *refreshView;
    //更多view @property (strong,nonatomic) BaseRMView *moreView;@property (assign,nonatomic) CGFloat baseOffsetY; @property (assign,nonatomic) CGFloat baseCanMove; //reload之前的行數,上拉更多的時候如果用戶滑動的距離超過行高會出錯,用beforeRowCount來比較rows來判斷新增的item需要添加的坐標 @property (assign,nonatomic) NSInteger beforeRowCount;//@property (assign,nonatomic) NSInteger firstShowCount; @end #pragma mark - #pragma mark 頁面初始化 -(id)init{CGRect frame=[UIScreen mainScreen].applicationFrame;self=[self initWithFrame:frame];if(self){}return self; }- (id)initWithFrame:(CGRect)frame {self = [super initWithFrame:frame];if (self) {_viewFrame=frame;self.delegate=self;_isFirstLoad=YES;_contentItemDictionary=[[NSMutableDictionary alloc] init];_isNeedShowMoreTag=NO;}return self; } #pragma mark - #pragma mark 數據初始化 -(void)loadData{if ([_dataSource respondsToSelector:@selector(numberOfItemsInCollection)]) {_numberOfItemsInCollection=[_dataSource numberOfItemsInCollection];}else{_numberOfItemsInCollection=0;}if([_dataSource respondsToSelector:@selector(numberOfItemsInRow)]){_numberOfItemsInRow=[_dataSource numberOfItemsInRow];_heightOfRow=((300.0-(_numberOfItemsInRow-1)*10)/_numberOfItemsInRow);_itemSpliteWidth=10;}else{_numberOfItemsInRow=3;//默認為3_heightOfRow=88;_itemSpliteWidth=18;}if ([_dataSource respondsToSelector:@selector(numberofMore)]) {_numberOfMore=[_dataSource numberofMore];}if ([_customDelegate respondsToSelector:@selector(isNeedRefreshOrMore)]) {_isNeedShowMoreTag=[_customDelegate isNeedRefreshOrMore];}if ([_customDelegate respondsToSelector:@selector(collectionViewForHeader)]) {_headerView=[_customDelegate collectionViewForHeader];if (![self.subviews containsObject:_headerView]) {[self addSubview:_headerView];}}//計算行數_rows=ceil((float)_numberOfItemsInCollection/_numberOfItemsInRow);CGFloat contentHeight=(_rows*_heightOfRow + (_rows+1)*10+_headerView.frame.size.height);CGFloat scrollContentHeight=contentHeight>_viewFrame.size.height?contentHeight:_viewFrame.size.height;//計算一頁能顯示多少行_showCount= (NSInteger)ceil((self.frame.size.height/(_heightOfRow+10)));[self setContentSize:CGSizeMake(320, scrollContentHeight)];//判斷是否有新增行,如果有當前最上義行index+1if (_rows!=_beforeRowCount&&_beforeRowCount!=0) {_topRowIndex++;}
      //從當前最上一行開始增加showcount行的itemfor (int i=_topRowIndex; i<_topRowIndex+_showCount; i++) {[self creatItem:i];}if (_isNeedShowMoreTag==YES) {if (![self.subviews containsObject:_refreshView]) {_refreshView=[[BaseRMView alloc] initWithState:Refresh];[_refreshView setFrame:CGRectMake(0, -50, 320, 50)];[_refreshView setBackgroundColor:[UIColor grayColor]];[self addSubview:_refreshView];
    } if (![self.subviews containsObject:_moreView]) {_moreView=[[BaseRMView alloc] initWithState:More];[_moreView setFrame:CGRectMake(0, self.contentSize.height, 320, 50)];[_moreView setBackgroundColor:[UIColor grayColor]];[self addSubview:_moreView];}else{[_moreView setFrame:CGRectMake(0, self.contentSize.height, 320, 50)];}} }

    ?

    -(void)layoutSubviews{
    //第一次加載時初始化數據,之后不需要重新計算if (_isFirstLoad) {[self loadData];//offsetY基數 只在第一次移動時候,10為默認的分割線高度_baseOffsetY=(10*(_showCount+1)+_heightOfRow*_showCount)-self.frame.size.height;//移動基數_baseCanMove=10+_heightOfRow;_isFirstLoad=NO;_lastRowIndex=_showCount-1;_topRowIndex=0;} } //重新加載數據,記錄加載前的行數
    -(void)reloadData{_beforeRowCount=_rows;[self loadData]; } #pragma mark - #pragma mark Item相關 -(void)creatItem:(NSInteger)rowIndex{if ([_customDelegate respondsToSelector:@selector(itemInCollectionAtPoint:collectionView:)]) {for (int j=0; j<_numberOfItemsInRow; j++) {//判斷當前個數是否超過了總個數(單數情況下)if (!(((rowIndex)*_numberOfItemsInRow+j+1)>_numberOfItemsInCollection)) {//根據委托創建itemCustomCollectionItem *item=[_customDelegate itemInCollectionAtPoint:CGPointMake(rowIndex, j) collectionView:self];//設置item的大小[item setFrame:CGRectMake(10+_heightOfRow*j+_itemSpliteWidth*j, 10+_heightOfRow*rowIndex+10*rowIndex+_headerView.frame.size.height, _heightOfRow, _heightOfRow)];//設置item的point坐標item.point=CGPointMake(rowIndex, j);//在view中加入item[self addSubview:item];}}} } //根據重用標志(reuseidentifier)從重用池中獲取item -(CustomCollectionItem *)dequeueReusableItemWithIdentifier:(NSString *)identifier{NSArray *cellArray=[self.contentItemDictionary objectForKey:identifier];if (cellArray.count==0) {return nil;}else{id firstObject=[cellArray objectAtIndex:0];if([firstObject isKindOfClass:[CustomCollectionItem class]]){//獲取item后從重用池中刪除item;CustomCollectionItem *item=firstObject;[[self.contentItemDictionary objectForKey:identifier] removeObject:firstObject];[item reset];return item;}else{return nil;}} } //根據point坐標從當前item數組中獲取item -(CustomCollectionItem *)getItemAtPoint:(CGPoint)point{CustomCollectionItem *result=nil;for (id item in self.subviews) {if ([item isKindOfClass:[CustomCollectionItem class]]) {if (((CustomCollectionItem *)item).point.x==point.x&& ((CustomCollectionItem *)item).point.y==point.y) {result=item;}}}return result; } -(void)addItemToPool:(CustomCollectionItem *)item{if([[self.contentItemDictionary allKeys] containsObject:item.reuseIdentifier]){[[self.contentItemDictionary objectForKey:item.reuseIdentifier] addObject:item];}else{NSMutableArray *cellArray=[NSMutableArray arrayWithObject:item];[self.contentItemDictionary setObject:cellArray forKey:item.reuseIdentifier];} } #pragma mark - #pragma mark 頁面滾動 //topRowIndex ---> 當前最上一行的index(從0開始); //lastRowIndex ---> 當前最后一行的index //removeIndex ---> 當前被移除的最后一行的行數(從1開始) //addIndex ---> 在showcount基礎上增加的行數 -(void)scrollViewDidScroll:(UIScrollView *)scrollView{@try {//手指向上移動移動基數后將顯示下一頁面//手指向下移動移動基數將移除最下一行BOOL isMoveUp=TRUE;//是否向下滑if (scrollView.contentOffset.y-_lastOffsetY>0) {isMoveUp=FALSE;}else{isMoveUp=TRUE;}_lastOffsetY=scrollView.contentOffset.y;//刷新更多if (scrollView.contentOffset.y==0) {if ([self.subviews containsObject:_refreshView]) {[_refreshView changeState:Refresh];}}else if(scrollView.contentOffset.y==scrollView.contentSize.height-scrollView.frame.size.height){if ([self.subviews containsObject:_moreView]) {[_moreView changeState:More];}}else if (scrollView.contentOffset.y>(scrollView.contentSize.height-scrollView.frame.size.height) ||scrollView.contentOffset.y<0) {if (scrollView.contentOffset.y>=(scrollView.contentSize.height-scrollView.frame.size.height+50)) {if ([self.subviews containsObject:_moreView]&&_moreView.viewState==More) {[_moreView changeState:ToMore];}}else if (scrollView.contentOffset.y<-50){if ([self.subviews containsObject:_refreshView]&&_refreshView.viewState==Refresh) {[_refreshView changeState:ToRefresh];}}}else{//判斷重用if (scrollView.contentOffset.y>_headerView.frame.size.height) {CGFloat realMove=scrollView.contentOffset.y-_headerView.frame.size.height;//增加的row坐標 初始為0 移動一個移動基數后加/減1NSInteger addIndex=ceil((realMove-_baseOffsetY)/_baseCanMove);//刪除的row坐標 初始為0 移動一個移動基數后加/減1NSInteger removeIndex=(realMove/_baseCanMove);//手指向上移動if (!isMoveUp) {//如果最后一行編號==增加的row坐標+1&&增加的row坐標<總行數-1if (_lastRowIndex==addIndex+_showCount-2&&addIndex<_rows-1) {//最后一行坐標++_lastRowIndex++;//如果最后一行坐標!=總行數;如果相等則為最后一行不需要增加if (_lastRowIndex!=_rows) {[self creatItem:_lastRowIndex];}}//如果刪除的row坐標!=0&&刪除的row坐標!=最上一行坐標&&最上一行坐標<總行數-顯示行數if (removeIndex!=0&&removeIndex!=_topRowIndex&&_topRowIndex<_rows-_showCount) {for (int i=0; i<_numberOfItemsInRow; i++) {CustomCollectionItem *item=[self getItemAtPoint:CGPointMake(removeIndex-1, i)];if (item!=nil) {[self addItemToPool:item];[item removeFromSuperview];}}_topRowIndex++;}}else{//remove-->add add-->removeif (removeIndex==_topRowIndex-1) {[self creatItem:removeIndex];_topRowIndex--;}if (addIndex!=0&&addIndex!=_lastRowIndex-_showCount+1) {if (_lastRowIndex==_rows) {_lastRowIndex--;}else{for (int i=0; i<_numberOfItemsInRow; i++) {CustomCollectionItem *item=[self getItemAtPoint:CGPointMake(_lastRowIndex, i)];if (item!=nil) {[self addItemToPool:item];[item removeFromSuperview];}}_lastRowIndex--;}}}}}}@catch (NSException *exception) {NSLog(@"customCollectionView exception %@",exception.reason);} } #pragma mark- #pragma mark item點擊 -(void)itemClickedAtPoint:(CGPoint)point{if ([_customDelegate respondsToSelector:@selector(itemDidSelectedAtPoint:)]) {[_customDelegate itemDidSelectedAtPoint:point];} } #pragma mark- #pragma mark 刷新更多-(void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{if (scrollView.contentOffset.y<-50) {if (_isNeedShowMoreTag==YES&&[self.subviews containsObject:_refreshView]) {if ([_customDelegate respondsToSelector:@selector(doCollectionRefresh)]) {[_customDelegate doCollectionRefresh];}[_refreshView changeState:EndRefresh];}}else if (scrollView.contentOffset.y>scrollView.contentSize.height-scrollView.frame.size.height+50){if (_isNeedShowMoreTag==YES&&[self.subviews containsObject:_moreView]) {if ([_customDelegate respondsToSelector:@selector(doCollectionMore)]) {[_customDelegate doCollectionMore];}[_moreView changeState:EndMore];}} } #import <UIKit/UIKit.h> #import <objc/runtime.h> #import <Foundation/Foundation.h> @interface CustomCollectionItem : UIView<UIGestureRecognizerDelegate,NSCoding> @property (strong,nonatomic) UIImageView *backgroundImage; @property (strong,nonatomic) NSString *reuseIdentifier; @property (assign,nonatomic) CGPoint point; -(id)initWithReuseIdentifier:(NSString *)identifier; -(void)itemTaped; -(void)reset; @end #import "CustomCollectionItem.h" #import "CustomCollectionView.h"@interface CustomCollectionItem() @property(strong,nonatomic) UIView *contentView; @end@implementation CustomCollectionItem-(id)initWithReuseIdentifier:(NSString *)identifier{self=[super init];if (self) {_reuseIdentifier=identifier;[self setUserInteractionEnabled:YES];_backgroundImage= [[UIImageView alloc] init];}return self; }-(void)setFrame:(CGRect)frame {[super setFrame:frame];[_backgroundImage setFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];_backgroundImage.tag=10099; }-(void)layoutSubviews {[super layoutSubviews];if([self viewWithTag:10099]== nil) {[self addSubview:_backgroundImage];[self sendSubviewToBack:_backgroundImage];}UITapGestureRecognizer *tapGR=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(itemTaped)];[self addGestureRecognizer:tapGR]; }-(void)itemTaped{[(CustomCollectionView *)[self superview] itemClickedAtPoint:self.point]; }-(void)setBackgroundImage:(UIImageView *)backgroundImage {_backgroundImage=backgroundImage; }#pragma override -(void)reset{}- (void)encodeWithCoder:(NSCoder*)coder {Class clazz = [self class];u_int count;objc_property_t* properties = class_copyPropertyList(clazz, &count);NSMutableArray* propertyArray = [NSMutableArray arrayWithCapacity:count];for (int i = 0; i < count ; i++){const char* propertyName = property_getName(properties[i]);[propertyArray addObject:[NSString stringWithCString:propertyName encoding:NSUTF8StringEncoding]];}free(properties);for (NSString *name in propertyArray){id value = [self valueForKey:name];[coder encodeObject:value forKey:name];} }- (id)initWithCoder:(NSCoder*)decoder {if (self = [super init]){if (decoder == nil){return self;}Class clazz = [self class];u_int count;objc_property_t* properties = class_copyPropertyList(clazz, &count);NSMutableArray* propertyArray = [NSMutableArray arrayWithCapacity:count];for (int i = 0; i < count ; i++){const char* propertyName = property_getName(properties[i]);[propertyArray addObject:[NSString stringWithCString:propertyName encoding:NSUTF8StringEncoding]];}free(properties);for (NSString *name in propertyArray){id value = [decoder decodeObjectForKey:name];[self setValue:value forKey:name];}}return self; } @end

    轉載于:https://www.cnblogs.com/LifeTechnologySupporter/p/5037806.html

    總結

    以上是生活随笔為你收集整理的iOS-UICollectionView的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

    91成人看片 | 欧美日韩国产二区三区 | 99精品视频免费看 | 91大神dom调教在线观看 | 久久国产精品99久久人人澡 | a视频免费 | 久久艹国产 | 久久不见久久见免费影院 | 亚洲视频免费在线观看 | 偷拍精品一区二区三区 | 精品亚洲视频在线观看 | 在线观看视频亚洲 | 亚洲激情六月 | 成人午夜精品久久久久久久3d | 亚洲a成人v| 国产精品美女久久久网av | 国产在线不卡精品 | 久久免费av | 亚洲精品国产精品国自产 | 成人欧美在线 | 黄色成人小视频 | 久草在线费播放视频 | 91av资源网 | 国产精品视频99 | 精品免费久久久久久 | 美女黄频在线观看 | 亚洲精品免费在线观看视频 | 999久久久久| 免费成人av | 国内三级在线观看 | 99视频这里只有 | 中文字幕在线不卡国产视频 | 久久综合色影院 | 国产亚洲精品久 | 欧美孕交vivoestv另类 | 成人免费观看视频大全 | 久久免费视频在线观看6 | 久久在线视频精品 | 99免费在线 | 国产免费又粗又猛又爽 | 97碰在线| 97在线观看免费观看高清 | 国产做爰视频 | www.91国产| www.超碰97.com | 国产亚洲精品久久网站 | 人人爽人人爽人人爽 | 亚洲专区 国产精品 | 91在线一区 | 黄色的网站在线 | 97在线视频观看 | 免费日韩视 | 五月天激情婷婷 | 欧美性直播 | 中文字幕在线视频国产 | 天天色天天爱天天射综合 | 日韩av电影中文字幕 | 婷婷日日| 98涩涩国产露脸精品国产网 | 亚洲精品久久久久58 | 超碰97久久| 精品美女久久久久久免费 | 99久在线精品99re8热视频 | 玖玖玖精品| 国产精品密入口果冻 | 九九激情视频 | 国产视频久久 | 欧美成亚洲 | 国产精品一码二码三码在线 | 亚洲一级黄色 | 性色大片在线观看 | 国产99在线免费 | 久久综合狠狠狠色97 | 香蕉免费| 天天干人人 | 97超碰资源| 久久国产精品影视 | 国产综合婷婷 | 久久99精品热在线观看 | 国产精品尤物视频 | 国产精品99久久久久 | 中文字幕一区二区三区在线视频 | 五月婷婷六月丁香 | 成人在线免费小视频 | 亚洲欧洲中文日韩久久av乱码 | 玖玖在线免费视频 | 99热超碰在线 | 欧美一级免费高清 | 久久久污 | 国产精品成人免费一区久久羞羞 | 四虎国产精品免费观看视频优播 | 青青河边草免费直播 | 久久不射电影院 | 狠狠色狠狠色综合日日92 | 国产精品免费久久久 | 91麻豆精品一区二区三区 | 黄网站www | 国产精品亚洲精品 | 日韩欧美在线视频一区二区 | 久久国产精品免费看 | 五月天,com| 免费亚洲黄色 | 亚洲精品女人久久久 | 亚洲尺码电影av久久 | 亚洲最大成人网4388xx | 日韩av中文字幕在线免费观看 | 久久久国产精品人人片99精片欧美一 | 国产伦精品一区二区三区四区视频 | 亚洲专区免费观看 | 激情五月婷婷综合网 | 亚洲午夜精品一区 | 久久免费精品视频 | 色综合欧洲| av免费在线观看1 | av电影免费观看 | 一级黄色片在线免费看 | 国产精品久久久一区二区 | 在线观看的a站 | 99久久久久久久久久 | 国产精品成人一区 | 久久视频在线观看 | 成年人视频在线观看免费 | 国产色资源| 国产一区在线免费观看视频 | av一级久久 | 中文字幕一区二 | 久久免费视频国产 | 日韩视频一区二区在线 | 四虎永久网站 | 国产精品18久久久久vr手机版特色 | 久久久久久久久久影院 | 国产精品一区在线观看 | 女女av在线 | 国产精彩在线视频 | 久久免费精品 | 成人国产精品免费观看 | 国产精品福利小视频 | 免费黄色av电影 | 在线成人一区二区 | 成人亚洲网| 精品国产视频在线 | 精品国产91亚洲一区二区三区www | 五月婷婷操 | av线上看 | 亚洲美女视频在线观看 | 96在线| 97**国产露脸精品国产 | 亚洲一区美女视频在线观看免费 | 成人中心免费视频 | 中文字幕精 | 亚洲综合成人婷婷小说 | www.天天干| 免费在线视频一区二区 | www五月天| 成人中文字幕在线 | 日韩欧美电影在线 | 操操操干干干 | 在线观看成人一级片 | 日本三级中文字幕在线观看 | 97看片吧 | 一二三四精品 | 香蕉视频亚洲 | 99视频黄| 国产黄在线免费观看 | 97精品国产97久久久久久春色 | 99视频这里只有 | 麻花豆传媒mv在线观看网站 | 国产剧情一区二区在线观看 | 日韩在线观看高清 | 日韩欧美一区二区三区在线观看 | 日日夜夜精品免费观看 | 国产精品久久久久久久久大全 | 三级av片 | 日一日操一操 | 日本爱爱免费 | 亚洲成人av一区二区 | 国产精品一区电影 | 日韩免费精品 | 在线观看色视频 | 亚洲在线精品视频 | 免费高清影视 | 97免费中文视频在线观看 | 午夜精品一区二区三区在线视频 | 亚洲一区二区观看 | 天天色天天搞 | 精品国内自产拍在线观看视频 | 亚州国产精品 | 国产区免费在线 | 国产一区二区三精品久久久无广告 | 欧美日韩国产一二 | 国产精品毛片一区二区在线 | 欧美日韩视频一区二区三区 | av久久在线 | av片在线观看 | 日韩在线免费播放 | 日韩av电影国产 | 91av视频网 | 麻豆传媒视频观看 | 开心婷婷色 | 97国产精品久久 | 天天夜夜亚洲 | 免费高清在线视频一区· | 天天操天天射天天爱 | 天堂入口网站 | 久久毛片视频 | 中文字幕电影网 | 精品福利在线视频 | 天堂中文在线视频 | 久久热亚洲 | 亚洲污视频 | 久久久久久久久久久免费视频 | 免费观看性生交 | 久久99亚洲精品久久久久 | 欧美一级日韩免费不卡 | 亚洲最大av网 | 久草在线视频免赞 | 欧美激情va永久在线播放 | 一区二区三区精品在线视频 | 欧洲成人av | 黄色a级片在线观看 | 日批视频在线播放 | 国产原创在线 | 欧美精品久久久久久久久久久 | 免费视频在线观看网站 | 97av影院 | 日韩精品一区二区在线 | 成年人国产精品 | 色妞久久福利网 | 91尤物国产尤物福利在线播放 | 日韩在线视频精品 | 国产精品视频免费观看 | 99热精品在线| 国产精品99久久久久久武松影视 | www免费视频com| 91欧美视频网站 | 伊人黄色网 | 日韩成人在线免费观看 | 国产精品成人av在线 | 久久精品激情 | 久久婷婷五月综合色丁香 | 黄色片毛片 | 国内精品99 | 国产福利91精品一区 | 一级电影免费在线观看 | 狠狠干中文字幕 | 日韩欧美精品一区 | 亚洲国产精品影院 | 国产香蕉在线 | 在线视频精品 | 美女视频黄是免费的 | 深夜福利视频在线观看 | 九九免费精品 | 香蕉影视在线观看 | 五月婷婷在线播放 | 欧美xxxxx在线视频 | 天天干,夜夜操 | 欧美色精品天天在线观看视频 | 日韩三级视频在线观看 | 偷拍福利视频一区二区三区 | 成人国产在线 | 天天操夜夜操夜夜操 | 激情五月播播久久久精品 | 久久精品一区八戒影视 | 免费看污污视频的网站 | 国产在线观看91 | av片在线观看 | 国产成人精品综合久久久久99 | 狠狠狠色丁香综合久久天下网 | 成人影音av | 国产破处在线播放 | 免费又黄又爽视频 | 国产精品av在线 | 亚洲激情六月 | 国产最新视频在线观看 | 精品国产午夜 | 18岁免费看片 | 一本之道乱码区 | 国产视频网站在线观看 | 欧美日韩精品在线播放 | 日韩中文字幕免费看 | 精品国产一区二区三区日日嗨 | 成人av一区二区在线观看 | 中文字幕日韩高清 | 国产欧美综合在线观看 | 免费视频久久久久久久 | 久久精品aaa | 亚洲四虎在线 | 日本一区二区不卡高清 | a级国产乱理伦片在线观看 亚洲3级 | 午夜精品久久久久久 | 国产剧在线观看片 | 99精品欧美一区二区蜜桃免费 | 亚洲一区二区视频 | 亚洲一区二区精品 | 美女久久久久久久久久 | 国产黄色片免费看 | 日韩成人在线免费观看 | 免费a网站 | 久久久久99精品成人片三人毛片 | 韩日精品在线观看 | 麻豆传媒视频观看 | 五月激情综合婷婷 | 成人国产精品一区 | 久久新 | 涩五月婷婷 | 国产护士hd高朝护士1 | 亚洲精品午夜久久久久久久 | 色激情五月 | 国产精品成人久久久 | 国产日韩欧美在线免费观看 | 天天射天天干天天插 | 麻豆91在线看 | 在线亚洲观看 | 99视频这里只有 | 久久综合狠狠综合 | 中文字幕中文字幕在线中文字幕三区 | 一区二区三区在线观看中文字幕 | 日韩在线视频不卡 | 亚洲精品在线观看av | 国产精品97| 婷香五月| 亚洲精品视频偷拍 | 婷婷激情5月天 | 狠狠操.com | 国产欧美日韩精品一区二区免费 | 免费色婷婷 | 日本最大色倩网站www | 日韩一区二区三区免费电影 | 日韩欧美在线第一页 | av在线一二三区 | 91亚洲精品国偷拍自产在线观看 | 91久久影院 | 天天干天天射天天插 | 色综合婷婷久久 | 亚洲精品国偷拍自产在线观看蜜桃 | 正在播放国产精品 | 国产日韩欧美视频在线观看 | 婷婷色网址 | 91精品网站在线观看 | 欧美福利在线播放 | 天天爱综合| 日韩色高清 | 欧美久久久久久久久 | 亚洲精品视频免费在线观看 | 国产精品粉嫩 | 一二区精品 | 激情五月在线观看 | 视频国产区 | 婷婷丁香激情 | 日韩理论片在线观看 | av免费网页 | 欧美在线资源 | 18网站在线观看 | 国产精品久久艹 | 91av视频免费在线观看 | 久草在线视频网 | 欧日韩在线 | 日韩高清成人在线 | 丝袜制服综合网 | 欧美午夜久久 | 人人超碰免费 | 中文字幕中文字幕在线中文字幕三区 | 亚洲精品资源 | 精品一二 | 91麻豆精品国产午夜天堂 | 国产精品久久99综合免费观看尤物 | 日本精品久久久一区二区三区 | 国产视频欧美视频 | 五月婷婷.com | 日韩美女黄色片 | 国产成人一二三 | a爱爱视频 | 国产精品黄色av | 中文字幕在线视频免费播放 | 97色婷婷人人爽人人 | 丁香六月国产 | 天天色天天干天天色 | 午夜久久影院 | 日本中文在线播放 | 欧美性春潮 | 又爽又黄又刺激的视频 | 午夜影院日本 | 国产美腿白丝袜足在线av | 91麻豆精品国产午夜天堂 | 成人h在线播放 | 久久成人国产 | 91麻豆精品91久久久久同性 | 国产精品久久久久一区二区 | 亚洲精品国产免费 | 蜜臀久久99精品久久久无需会员 | 亚洲成年人在线播放 | 久久久久久久久久久久av | 午夜精品三区 | 天天天干天天射天天天操 | 天天天综合 | 亚洲精品在线观看免费 | 久久久国产视频 | 香蕉一区| 国产91精品高清一区二区三区 | 不卡精品 | 91麻豆精品国产自产 | 久久er99热精品一区二区三区 | 在线观看免费一区 | 91麻豆高清视频 | 国产免费久久 | 国产一区二区在线免费播放 | 最新免费中文字幕 | 欧美少妇xx| 在线国产99 | 欧美国产日韩一区二区三区 | 成人羞羞视频在线观看免费 | 91最新网址 | 国产色在线视频 | 精品综合久久 | a电影在线观看 | 日韩在线观看第一页 | 黄色视屏免费在线观看 | 日韩久久久 | 99热这里只有精品久久 | 天天色天天色 | 91精品毛片 | 国产小视频福利在线 | 亚洲无吗av | 国产一区欧美一区 | 欧洲精品久久久久毛片完整版 | 人人擦 | 亚洲日本va中文字幕 | 精品国产精品国产偷麻豆 | 亚洲激情 欧美激情 | 天堂av在线网址 | 亚洲精品国偷拍自产在线观看蜜桃 | 狠狠的干狠狠的操 | 欧美精选一区二区三区 | 亚洲成人资源在线 | 在线观看色视频 | 91丨九色丨蝌蚪丨对白 | 日本在线观看中文字幕无线观看 | 96超碰在线 | 不卡电影免费在线播放一区 | 成人福利在线播放 | 国产成人免费观看 | 日韩精品在线观看av | av福利在线免费观看 | 美女黄频在线观看 | 亚洲欧美日韩精品久久奇米一区 | www视频在线播放 | 在线观看涩涩 | 在线视频婷婷 | 日韩视频中文字幕 | 国产精品激情 | 日韩免费一区二区三区 | 91在线观看欧美日韩 | 狠狠五月婷婷 | 97精品在线观看 | 国产九九九视频 | 97视频一区 | 开心丁香婷婷深爱五月 | a视频在线 | www国产亚洲精品久久网站 | 特级西西www44高清大胆图片 | 国内视频在线 | 婷婷视频导航 | 久久久www成人免费精品 | 四虎在线免费观看视频 | 欧美日韩一区二区三区在线免费观看 | 天天色棕合合合合合合 | 亚洲精品九九 | 丁香婷婷深情五月亚洲 | 欧美在线观看视频免费 | 九九爱免费视频在线观看 | 亚洲精品国产区 | 98精品国产自产在线观看 | 国产精品久久久免费 | av黄色在线观看 | 国产精品免费久久久久 | 久草视频在线观 | 午夜精品久久 | 日韩免费视频一区二区 | 中文字幕一区二区三区视频 | 色婷婷综合视频在线观看 | 一级黄色免费网站 | 免费福利片| 麻豆91小视频| 免费在线观看一级片 | 中文字幕国产 | 国产伦理久久精品久久久久_ | 久久国产麻豆 | 韩日精品在线观看 | 成人影片在线免费观看 | 九色91在线 | 欧美成a人片在线观看久 | 国产久视频 | 亚洲经典中文字幕 | 亚洲国产三级 | 五月天婷婷免费视频 | 成年一级片 | 99热精品免费观看 | 黄色av电影 | 综合五月 | 涩涩网站免费 | 五月婷婷激情六月 | 美女网站在线观看 | 欧美日韩破处 | 亚洲国产成人高清精品 | 久久久高清视频 | 国产精品久久久久久久久久久免费 | 久久久999精品视频 国产美女免费观看 | 色综合天天在线 | 丁香九月激情 | 99r在线观看 | 狠狠色狠狠色综合日日小说 | 97人人看 | 丁香网五月天 | 国产免费视频一区二区裸体 | www激情com | 91在线欧美 | 视频成人永久免费视频 | 久草热视频 | 伊人国产视频 | 国产91丝袜在线播放动漫 | 国产精品中文字幕在线 | 成人在线播放免费观看 | 国产亚洲一区二区三区 | 手机成人av | 久久激情五月婷婷 | 伊人春色电影网 | 五月天综合网站 | 天天干天天摸天天操 | 视频成人永久免费视频 | a级国产片 | 免费三级a| 婷婷六月色 | 深爱激情五月婷婷 | 成全在线视频免费观看 | 国产精久久 | 91久久久久久国产精品 | 欧美成人h版电影 | 天堂av在线网站 | 视频国产在线观看18 | 在线亚洲成人 | 免费一级片视频 | 五月婷激情| 麻豆视频大全 | 欧美日韩亚洲在线观看 | 一本一本久久aa综合精品 | 亚洲成a人片在线观看网站口工 | 国产黄免费在线观看 | 亚洲区视频在线观看 | 日本99精品 | 黄色高清视频在线观看 | 在线国产福利 | 久久伊人热 | 99草在线视频 | 久久精品老司机 | 欧美一区二区三区在线看 | 亚洲国产精品一区二区久久hs | 亚洲三级黄色 | 国内99视频 | 日本黄色免费在线 | 久久国产热 | 国产精品一区二区三区在线免费观看 | 在线中文字幕电影 | 最新国产一区二区三区 | 日韩精品视频在线观看网址 | 国产91综合一区在线观看 | 一区二区视频欧美 | 国产中文视频 | 亚洲免费在线观看视频 | 国产精品国产自产拍高清av | www五月| 中文字幕乱码电影 | 中文字幕精| 色综合久久66 | 亚洲一区二区视频在线 | www国产精品com | 国产精品国产毛片 | 欧美在线视频一区二区三区 | 99国产在线视频 | 国产美女在线免费观看 | 黄色精品网站 | 亚洲 欧美变态 另类 综合 | 久久久久黄色 | 国产亚洲精品v | 麻豆国产视频 | 久久精品国产一区二区电影 | 99久久夜色精品国产亚洲96 | 一级成人在线 | 一级免费黄视频 | 国产成人三级一区二区在线观看一 | 91精品国产99久久久久 | 99视频在线观看视频 | 在线观看中文 | 色婷婷狠狠18 | 97色在线视频 | 九九九电影免费看 | 伊人中文在线 | 天堂在线成人 | 久久久激情网 | 午夜精品三区 | 成人免费色 | 啪啪免费视频网站 | 久久综合成人网 | 国产亚洲一区二区三区 | 蜜臀av性久久久久蜜臀av | 一本之道乱码区 | 国产精品露脸在线 | 六月丁香综合网 | 久久私人影院 | 亚州国产精品 | 国产免费a | 亚洲一级片在线看 | 天天操夜夜操国产精品 | 99视频这里有精品 | 午夜天使 | 日韩有色 | 国产大片黄色 | 精品久久久久久久久久岛国gif | 8x成人免费视频 | 97精品国产97久久久久久久久久久久 | av网址在线播放 | 久久草av | 天天摸夜夜操 | 欧美99热 | 国产一区二区在线观看免费 | 日本中文一级片 | 国产福利免费在线观看 | 在线观看岛国片 | 国产精品久久久久久久久久99 | 日韩va亚洲va欧美va久久 | 99精品在线免费视频 | 波多野结依在线观看 | 草久热| 国产成人精品综合久久久 | av一级片| 99国产精品一区二区 | 国产成人61精品免费看片 | 欧美日韩精品影院 | av天天在线观看 | 成人羞羞视频在线观看免费 | 国产精品永久在线观看 | 在线观看中文字幕dvd播放 | 日本在线观看一区二区三区 | 国产精品第一 | 久久久免费精品 | 伊人日日干 | 97色婷婷人人爽人人 | 亚洲精品中文字幕在线 | 亚洲欧洲精品久久 | 国产一二三在线视频 | 色吊丝在线永久观看最新版本 | 精品久久久久久久久久久院品网 | 日本精品视频在线观看 | 精品国偷自产在线 | 久久免费视频这里只有精品 | 欧美黑人性爽 | 成人动漫一区二区 | 欧美激情精品久久久久久免费 | 狠狠色狠狠综合久久 | 91九色在线观看视频 | 久久国产欧美日韩精品 | 久久午夜色播影院免费高清 | 欧美午夜精品久久久久久孕妇 | av福利在线导航 | 中文字幕在线电影 | 在线看污网站 | 久久九九久久 | av网站免费看 | 欧美日韩中文视频 | av中文字幕网 | 久久视频精品在线 | 夜夜夜夜夜夜操 | av理论电影 | 96国产在线| 韩国视频一区二区三区 | 日韩在线字幕 | 99国产情侣在线播放 | 男女激情免费网站 | 91视频啊啊啊 | 玖草在线观看 | 国产精品国产亚洲精品看不卡15 | 欧美日韩中文另类 | 五月综合在线观看 | 手机av在线免费观看 | 天天夜夜操 | 狠狠干天天色 | 在线观看亚洲视频 | 在线免费试看 | 久久久免费播放 | 人人精久 | 91人人干 | 亚洲成年人免费网站 | 亚洲综合欧美日韩狠狠色 | 免费成人在线电影 | 国产精品第一页在线观看 | 伊色综合久久之综合久久 | 久久蜜桃av | 成人av教育 | 夜夜爽www | 97夜夜澡人人爽人人免费 | 99久久精品国产一区 | 日韩二区在线播放 | 中文在线最新版天堂 | 91中文视频 | 免费三级黄 | 免费观看版 | 丰满少妇高潮在线观看 | 亚洲欧洲av在线 | 午夜影院一级 | 天堂av在线| 亚洲国产精品久久久 | 中文字幕久久精品 | 免费在线观看av电影 | 在线观看视频在线观看 | 久久在草 | 午夜精品电影一区二区在线 | 亚洲免费av一区二区 | 美女视频黄是免费的 | 国产成人久久 | 波多野结衣电影久久 | 可以免费观看的av片 | 久久综合精品一区 | 一级黄色片在线播放 | 一级理论片在线观看 | 国产一区精品在线 | 97视频在线观看视频免费视频 | 97国产一区二区 | 欧美视频国产视频 | 色狠狠一区二区 | 99操视频 | 国产精品久久久久久久久久三级 | 国产麻豆果冻传媒在线观看 | 久久dvd | 欧美性色黄 | 日韩二区三区 | 久久综合影院 | 成人在线观看你懂的 | 久久国产精品99精国产 | 丁香六月av | 国产视频精品视频 | 久久视频免费观看 | 国产精品短视频 | 免费一级片在线观看 | 91日韩精品一区 | 免费在线观看av网站 | 婷婷在线资源 | 又黄又爽又刺激 | 天天玩天天干 | 亚洲午夜久久久久久久久 | 欧美一级在线观看视频 | 91精品一区二区三区蜜臀 | 日本爱爱免费 | 婷婷久久婷婷 | 麻豆视频在线观看 | 天天操天天射天天操 | 二区三区精品 | 久草精品在线播放 | 国产日韩精品在线观看 | 日韩欧美在线一区二区 | 国产精品久久久久三级 | 日韩一区二区免费视频 | 狠狠色伊人亚洲综合网站野外 | 国产在线成人 | 黄色片免费看 | 人人插人人费 | 成人一区二区三区中文字幕 | 国产涩图 | 久久se视频| 日韩高清av | 久久免费99 | 天天综合五月天 | 国产99久久 | 在线免费观看涩涩 | 青青色影院 | 久久久久久久久久久网站 | 极品嫩模被强到高潮呻吟91 | 久久亚洲在线 | 国产一区二区三区视频在线 | av免费电影在线观看 | av黄色成人| 国产午夜精品一区二区三区欧美 | av成人在线播放 | 99爱在线观看 | 欧美日韩网站 | 91免费网站在线观看 | 国产精品毛片久久久久久久久久99999999 | 激情 亚洲| 国产精品永久久久久久久久久 | 亚洲日本色 | 99精品热视频只有精品10 | 久久这里只精品 | 波多野结衣在线视频免费观看 | 成人免费在线看片 | 天海翼一区二区三区免费 | 中文字幕在线看片 | 久久伊人精品一区二区三区 | 日韩激情久久 | 国产视频亚洲精品 | 色欧美日韩| 激情av在线资源 | 午夜免费电影院 | 最近高清中文字幕 | 国产精品毛片久久久久久久久久99999999 | 综合国产在线 | 在线国产91 | av中文资源在线 | 国产成人在线精品 | 欧美91在线| 中文字幕激情 | 中文字幕免费高清在线 | 夜夜骑日日 | 久久综合久久鬼 | 五月激情天 | 国产精品麻豆果冻传媒在线播放 | 亚洲欧美一区二区三区孕妇写真 | 五月婷婷免费 | 香蕉视频在线免费 | 成全免费观看视频 | 色婷婷视频在线观看 | 久久99国产精品免费网站 | 99久久精品国产一区二区成人 | 国产午夜麻豆影院在线观看 | 最近2019好看的中文字幕免费 | 日韩精品在线观看视频 | 欧美日韩久久一区 | 一区二区三区手机在线观看 | 99视频精品全国免费 | 国产成人免费在线 | 天天干天天拍天天操天天拍 | 久久久久久久久毛片 | 五月天激情综合网 | 成人国产一区 | 成人av电影在线 | 免费h漫在线观看 | 久久不射电影网 | 9在线观看免费高清完整 | 国产三级精品三级在线观看 | 狠狠干 狠狠操 | 9ⅰ精品久久久久久久久中文字幕 | 久久久久免费精品国产 | 色久综合| 国产五月婷婷 | 午夜色性片| 亚州成人av在线 | 欧美日韩国产精品久久 | 91观看视频 | 中文字幕在线播放一区 | 久久婷婷影视 | 久久电影国产免费久久电影 | 天天射天天操天天 | 婷婷成人综合 | 久草在线手机视频 | 亚洲色五月| 久久免费视频8 | 欧美a级一区二区 | 国产精品va在线观看入 | 天天爱天天舔 | 一区二区 不卡 | 深夜免费小视频 | 五月导航 | 久久婷婷网 | 24小时日本在线www免费的 | 国产成人免费高清 | 中文字幕在 | 在线国产99 | 欧美精品久久久久久久久免 | 国产91免费在线观看 | 97人人模人人爽人人少妇 | 亚洲影视九九影院在线观看 | 国产成人黄色在线 | 人人超碰免费 | 亚洲国产网站 | 伊人午夜视频 | 亚洲综合五月 | 亚洲精品小视频 | 日韩精品一区二区三区视频播放 | 国产精品2018 | 97小视频| 亚洲第一伊人 | 日本中文字幕免费观看 | 狠狠成人 | 人人爽人人爽av | 久久国产露脸精品国产 | 欧美日韩3p| 五月天六月婷 | 欧美巨乳网 | 国产亚洲成av人片在线观看桃 | 91麻豆精品国产91久久久久 | 国产视频精选在线 | www.狠狠操 | 日本高清免费中文字幕 | 日韩精品免费在线 | 亚洲在线视频免费 | 日韩精品中文字幕在线不卡尤物 | av在线h | 成年人国产在线观看 | 91精品国产欧美一区二区 | 久热电影| 狠狠狠狠狠狠狠狠 | 五月婷婷丁香综合 | 夜夜骑天天操 | 狠狠的操狠狠的干 | 亚洲视频免费视频 | 国产精品久久久久久999 | 久久免费视频这里只有精品 | 永久免费的啪啪网站免费观看浪潮 | 国产专区一 | 国模视频一区二区 | 久久三级视频 | 欧美一级视频在线观看 | 天天操天天摸天天干 | 久视频在线播放 | 国产美女网站视频 | 91视频免费网址 | 免费中午字幕无吗 | 在线播放视频一区 | 国内视频在线 | 国产精品破处视频 | 国产免费黄视频在线观看 | 国产成人精品在线播放 | 国产一区二区三区免费在线观看 | 五月天婷婷免费视频 | 日韩大片在线播放 | 蜜臀av网址 | 黄色免费高清视频 | 国产黄色在线网站 | 欧美精品中文字幕亚洲专区 | 日韩中文字幕在线 | 亚洲精品黄网站 | 亚州精品天堂中文字幕 | 亚洲欧美日本国产 | 久久久久这里只有精品 | 国产精品第10页 | 亚洲天堂网在线观看视频 | 国产精品久久久免费看 | 91成人看片| 国产黄色精品网站 | 欧美久久久 | 成人免费看黄 | 天天干夜夜夜操天 | 手机在线永久免费观看av片 | 91麻豆精品国产91久久久使用方法 | 国产流白浆高潮在线观看 | 99精品国产兔费观看久久99 | 精品自拍网| 久久经典国产 | 久久久久久久久久久久久国产精品 | 天天操天天色天天射 | 国内精品久久久久国产 | 99视频导航 | 91精品久久久久久粉嫩 | 九九热精品视频在线播放 | 久久久久成人精品亚洲国产 | 五月婷婷在线视频 | 日韩av不卡在线播放 | 欧美a在线免费观看 | 在线影院 国内精品 | 日韩大片在线播放 | 精品国产美女 | 色婷婷综合久久久久中文字幕1 | 国产视频亚洲视频 | 一级黄色a视频 | 亚洲国产成人久久综合 | 国产日韩中文字幕 | 国产网红在线 | 最近中文字幕在线中文高清版 | 8x8x在线观看视频 | 婷婷丁香视频 | 免费看的黄网站 | jizz999| 国产在线a免费观看 | 精品久久精品久久 | 成人va在线观看 | 一区二区视频播放 | 精品久久久久久综合日本 | 一级黄色在线免费观看 | 蜜臀久久99精品久久久无需会员 | 成人三级网址 | 狠狠色丁香九九婷婷综合五月 | 亚洲欧洲精品视频 | 粉嫩av一区二区三区四区五区 | 欧美成人影音 | 国产精品专区一 | 欧美一区在线观看视频 | 欧美日韩高清不卡 | 婷婷在线视频观看 | 毛片www | 丁香视频| 欧美一区,二区 | 99久久精品国产网站 | 中文字幕av全部资源www中文字幕在线观看 | 日韩精品在线免费播放 | 免费久久99精品国产 | 亚a在线| 热久久99这里有精品 | 精品五月天 | 国产精品日韩 | 国产精品福利在线 | 涩涩网站免费 |