日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

iOS之仿QQ好友列表展开收缩效果的实现

發(fā)布時(shí)間:2024/5/21 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 iOS之仿QQ好友列表展开收缩效果的实现 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

使用UICollectionView實(shí)現(xiàn)

思路
  • 很明顯整體它是一個(gè)列表,它的分組是一個(gè)列表,它里面的好友列表也是一個(gè)列表,所以就可以使用組頭來(lái)設(shè)置分組列表,使用cell設(shè)置好友列表;
  • 當(dāng)點(diǎn)擊組頭的時(shí)候會(huì)展開(kāi)好友列表,其實(shí)原理上就是單獨(dú)刷新某一組的數(shù)據(jù)。
流程
  • 控制器的代碼(HomeViewController):本類(lèi)主要配置UICollectionView顯示,以及處理組展開(kāi)/關(guān)閉狀態(tài)。
#import "HomeViewController.h" #import "YDWFriendListShowCollectionViewCell.h" #import "YDWFriendHeaderReusableView.h"static NSString * const kYDWFriendListShowCollectionViewCellIndentifier = @"YDWFriendListShowCollectionViewCell"; static NSString * const kYDWFriendHeaderReusableViewIndentifier = @"YDWFriendHeaderReusableView";@interface HomeViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,FriendHeaderReusableViewDelegate>/**添加collectionView*/ @property(nonatomic,strong) UICollectionView *collectionView; /**好友組頭列表數(shù)組*/ @property(nonatomic,strong) NSArray *headerArray; /**好友列表數(shù)據(jù)*/ @property (nonatomic, strong) NSMutableArray * dataArray; /**存儲(chǔ)是否展開(kāi)的BOOL值*/ @property (nonatomic, strong) NSMutableArray * boolArray;@end@implementation HomeViewController- (void)viewDidLoad {[super viewDidLoad];[self setupNavigation];[self addSubviews];[self getListData]; }#pragma mark - UICollectionViewDelegate,UICollectionViewDataSource - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {return self.headerArray.count; }- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {// 判斷是否展開(kāi),如果未展開(kāi)則返回0if ([self.boolArray[section] boolValue] == NO) {return 0;} else {return [self.dataArray[section] count];} }- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {YDWFriendListShowCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kYDWFriendListShowCollectionViewCellIndentifier forIndexPath:indexPath];cell.contentView.backgroundColor = [UIColor whiteColor];cell.nameLabel.text = [NSString stringWithFormat:@"好友%ld", (long)indexPath.item];cell.detailsLabel.text = [NSString stringWithFormat:@"簽名%ld", (long)indexPath.item];return cell; }- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {YDWFriendHeaderReusableView *reusView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:kYDWFriendHeaderReusableViewIndentifier forIndexPath:indexPath];reusView.delegte = self;reusView.backgroundColor = [UIColor whiteColor];reusView.tag = indexPath.section;// 三目運(yùn)算選擇展開(kāi)或者閉合時(shí)候的圖標(biāo)reusView.imageView.image = [self.boolArray[indexPath.section] boolValue] ? [UIImage imageNamed:[NSString stringWithFormat:@"zhankai"]] : [UIImage imageNamed:[NSString stringWithFormat:@"shouqi"]];reusView.titleLabel.text = self.headerArray[indexPath.section];reusView.numLabel.text = [NSString stringWithFormat:@"%ld/%lu",(long)indexPath.section, (unsigned long)[self.dataArray[indexPath.section] count]];return reusView; }#pragma mark - FriendHeaderReusableViewDelegate - (void)friendHeaderReusableView:(YDWFriendHeaderReusableView *)friendHeaderReusableView didSelectItemAtSection:(NSInteger)section {if ([self.boolArray[section] boolValue] == YES) {[self.boolArray replaceObjectAtIndex:section withObject:@NO];} else {[self.boolArray replaceObjectAtIndex:section withObject:@YES];}[self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:section]]; }#pragma mark - Private Methods - (void)setupNavigation {self.navigationItem.title = @"聯(lián)系人"; }- (void)addSubviews {self.collectionView.frame = CGRectMake(0, 100, SCREEN_WIDTH, SCREEN_HEIGHT - 15);[self.view addSubview:self.collectionView]; }- (void)getListData {// 準(zhǔn)備組頭的數(shù)據(jù)NSArray *headerArr = [NSArray arrayWithObjects:@"特別關(guān)心", @"我的好友", @"朋友", @"家人",nil];self.headerArray = headerArr;// 準(zhǔn)備單元格的數(shù)據(jù)NSArray *itemArr = [NSArray arrayWithObjects:@5, @10, @7,@3, nil];for (int i = 0; i < self.headerArray.count; i++) {// 所有的分組默認(rèn)關(guān)閉[self.boolArray addObject:@NO];// 給每個(gè)分組添加數(shù)據(jù)NSMutableArray * friendArr = [[NSMutableArray alloc] init];for (int j = 0; j < [itemArr[i] intValue]; j++) {[friendArr addObject:@(j)];}[self.dataArray addObject:friendArr];}[self.collectionView reloadData]; }#pragma mark - Lazy Loading - (NSMutableArray *)dataArray {if (!_dataArray) {_dataArray = [[NSMutableArray alloc] init];}return _dataArray; }- (NSMutableArray *)boolArray {if (!_boolArray) {_boolArray = [[NSMutableArray alloc] init];}return _boolArray; }- (UICollectionView *)collectionView {if (!_collectionView) {UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];layout.itemSize = CGSizeMake(SCREEN_WIDTH, 70);layout.minimumLineSpacing = 0;layout.minimumInteritemSpacing = 0;layout.scrollDirection = UICollectionViewScrollDirectionVertical;layout.headerReferenceSize = CGSizeMake(SCREEN_WIDTH, 40);_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];_collectionView.backgroundColor = [UIColor whiteColor];_collectionView.delegate = self;_collectionView.dataSource = self;_collectionView.alwaysBounceVertical = YES;_collectionView.showsVerticalScrollIndicator = YES;[_collectionView registerClass:[YDWFriendHeaderReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:kYDWFriendHeaderReusableViewIndentifier];[_collectionView registerClass:[YDWFriendListShowCollectionViewCell class] forCellWithReuseIdentifier:kYDWFriendListShowCollectionViewCellIndentifier];}return _collectionView; } @end
  • YDWFriendHeaderReusableView:本類(lèi)主要布局組標(biāo)題以及指示(展開(kāi)/關(guān)閉)控件,其次,通過(guò)添加點(diǎn)擊手勢(shì)結(jié)合委托模式,傳遞tag值。
    YDWFriendHeaderReusableView .h和YDWFriendHeaderReusableView.m:
#import <UIKit/UIKit.h>NS_ASSUME_NONNULL_BEGIN @class YDWFriendHeaderReusableView; @protocol FriendHeaderReusableViewDelegate <NSObject>- (void)friendHeaderReusableView:(YDWFriendHeaderReusableView *)friendHeaderReusableView didSelectItemAtSection:(NSInteger)section;@end@interface YDWFriendHeaderReusableView : UICollectionReusableView@property(nonatomic,weak) id <FriendHeaderReusableViewDelegate>delegte;/**圖標(biāo)*/ @property(nonatomic,weak) UIImageView *imageView; /**標(biāo)題*/ @property(nonatomic,weak) UILabel *titleLabel; /**人數(shù)*/ @property(nonatomic,weak) UILabel *numLabel; @endNS_ASSUME_NONNULL_END #import "YDWFriendHeaderReusableView.h"@interface YDWFriendHeaderReusableView ()@end@implementation YDWFriendHeaderReusableView#pragma mark - 初始化 - (instancetype)initWithFrame:(CGRect)frame {self = [super initWithFrame:frame];if (self) {self.userInteractionEnabled = YES;UITapGestureRecognizer *tapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clickView:)];[self addGestureRecognizer:tapGes];[self addSubviews];}return self; }#pragma mark - 設(shè)置UI界面 - (void)addSubviews {// 添加圖標(biāo)UIImageView *imageView = [[UIImageView alloc] init];[self addSubview:imageView];self.imageView = imageView;// 添加標(biāo)題UILabel *titleLabel = [[UILabel alloc] init];titleLabel.font = [UIFont systemFontOfSize:18];titleLabel.textColor = [UIColor darkGrayColor];[self addSubview:titleLabel];self.titleLabel = titleLabel;// 添加人數(shù)UILabel *numLabel = [[UILabel alloc] init];numLabel.font = [UIFont systemFontOfSize:14];numLabel.textAlignment = NSTextAlignmentRight;numLabel.textColor = [UIColor lightGrayColor];[self addSubview:numLabel];self.numLabel = numLabel;}/**調(diào)用父類(lèi)布局子視圖*/ - (void)layoutSubviews {[super layoutSubviews];// 圖標(biāo)self.imageView.frame = CGRectMake(10, 10, 20, 20);// 標(biāo)題CGFloat numW = 60;CGFloat titleX = CGRectGetMaxX(self.imageView.frame) + 10;CGFloat titleW = SCREEN_WIDTH - titleX - numW -15;self.titleLabel.frame = CGRectMake(titleX, 10, titleW, 20);// 人數(shù)CGFloat numX = SCREEN_WIDTH - numW - 10;self.numLabel.frame = CGRectMake(numX, 10, numW, 20); }#pragma mark - 監(jiān)聽(tīng)事件 - (void)clickView:(UITapGestureRecognizer *)tapGes {if ([self.delegte respondsToSelector:@selector(friendHeaderReusableView:didSelectItemAtSection:)]) {[self.delegte friendHeaderReusableView:self didSelectItemAtSection:self.tag];} } @end
  • YDWFriendListShowCollectionViewCell:主要布局好友信息包括頭像、昵稱(chēng)以及簽名,具體實(shí)現(xiàn)如下:
#import <UIKit/UIKit.h>NS_ASSUME_NONNULL_BEGIN@interface YDWFriendListShowCollectionViewCell : UICollectionViewCell@property(nonatomic,weak) UIImageView *imageView; @property(nonatomic,weak) UILabel *nameLabel; @property(nonatomic,weak) UILabel *detailsLabel;@endNS_ASSUME_NONNULL_END #import "YDWFriendListShowCollectionViewCell.h"@interface YDWFriendListShowCollectionViewCell ()@end@implementation YDWFriendListShowCollectionViewCell#pragma mark - 初始化 - (instancetype)initWithFrame:(CGRect)frame {self = [super initWithFrame:frame];if (self) {[self addSubviews];}return self; }#pragma mark - 設(shè)置UI界面 - (void)addSubviews {// 添加圖標(biāo)UIImageView *imageView = [[UIImageView alloc] init];imageView.layer.cornerRadius = 50/2;imageView.layer.masksToBounds = YES;imageView.backgroundColor = [UIColor colorWithRed:arc4random_uniform(256)/255.0 green:arc4random_uniform(256)/255.0 blue:arc4random_uniform(256)/255.0 alpha:1.0];[self addSubview:imageView];self.imageView = imageView;// 添加標(biāo)題UILabel *nameLabel = [[UILabel alloc] init];nameLabel.font = [UIFont systemFontOfSize:18];nameLabel.textColor = [UIColor darkGrayColor];[self addSubview:nameLabel];self.nameLabel = nameLabel;// 添加簽名UILabel *detailsLabel = [[UILabel alloc] init];detailsLabel.font = [UIFont systemFontOfSize:14];detailsLabel.textAlignment = NSTextAlignmentLeft;detailsLabel.textColor = [UIColor lightGrayColor];[self addSubview:detailsLabel];self.detailsLabel = detailsLabel;}/**調(diào)用父類(lèi)布局子視圖*/ - (void)layoutSubviews {[super layoutSubviews];//1、圖標(biāo)self.imageView.frame = CGRectMake(10, 10, 50, 50);//2、標(biāo)題CGFloat nameX = CGRectGetMaxX(self.imageView.frame) + 10;CGFloat nameW = SCREEN_WIDTH - nameX -10;self.nameLabel.frame = CGRectMake(nameX, 10, nameW, 20);//3、人數(shù)CGFloat detailsX = CGRectGetMaxX(self.imageView.frame) + 10;CGFloat detailsY = CGRectGetMaxY(self.nameLabel.frame) + 5;CGFloat detailsW = SCREEN_WIDTH - detailsX - 10;self.detailsLabel.frame = CGRectMake(detailsX, detailsY, detailsW, 20); } @end
效果展示

使用UITableView實(shí)現(xiàn)

思路
  • 這個(gè)可以展開(kāi)收縮的UITableView,點(diǎn)擊的是TableView的section,每個(gè)section下面都對(duì)應(yīng)一個(gè)數(shù)組,點(diǎn)擊section,就展開(kāi)sction然后展示數(shù)組數(shù)據(jù)。
  • 每次點(diǎn)擊section都要刷新當(dāng)前點(diǎn)擊的這個(gè)section,不用reloadData,提高效率。
  • 那么點(diǎn)擊的這個(gè)sction怎么知道自己是展開(kāi)呢還是折疊起來(lái)呢?那么關(guān)鍵就是對(duì)這里的處理,需要加一個(gè)條件判斷是展開(kāi)還是折疊。
實(shí)現(xiàn)方法
  • 用一個(gè)boolArray去記錄每個(gè)section的狀態(tài),當(dāng)然光記錄還是不行的,還是不斷的改變這個(gè)boolArray對(duì)應(yīng)section的值,展開(kāi)了就把值替換為1,閉合了替換了0.那么這個(gè)0和1就是我們的依據(jù),依據(jù)這個(gè)就可以返回這個(gè)scetion對(duì)應(yīng)的row了。
  • 用一個(gè)類(lèi)去記錄和不斷的替換狀態(tài),該model類(lèi)增加一個(gè)狀態(tài)判斷的字段;
流程
  • 控制器的代碼:本類(lèi)主要配置UITableView顯示,以及處理組展開(kāi)/關(guān)閉狀態(tài)。
#import "YDWSecondViewController.h" #import "YDWFriendListShowTableViewCell.h" #import "YDWFriendHeadView.h"static NSString * const kYDWFriendListShowTableViewCellIndentifier = @"YDWFriendListShowTableViewCell"; static NSString * const kYDWFriendHeadViewIndentifer = @"YDWFriendHeadView";@interface YDWSecondViewController ()<UITableViewDelegate,UITableViewDataSource,FriendHeadViewDelegate>@property (nonatomic, strong) UITableView *tableView;@property(nonatomic,strong) NSArray *headerArray; @property (nonatomic, strong) NSMutableArray * dataArray; @property (nonatomic, strong) NSMutableArray * boolArray;@end@implementation YDWSecondViewController- (void)viewDidLoad {[super viewDidLoad];[self setupNavigation];[self setupAddTableView];[self getListData]; }#pragma mark - UITableViewDelegate,UITableViewDataSource - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {return self.dataArray.count; }- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {if ([self.boolArray[section] boolValue] == NO) {return 0;} else {return [self.dataArray[section] count];} }- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {YDWFriendListShowTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kYDWFriendListShowTableViewCellIndentifier];if (!cell) {cell = [[NSBundle mainBundle] loadNibNamed:@"YDWFriendListShowTableViewCell" owner:self options:nil].firstObject;}cell.selectionStyle = UITableViewCellSelectionStyleNone;return cell; }- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {return 40; }- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {YDWFriendHeadView *headeView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:kYDWFriendHeadViewIndentifer];if (headeView == nil) {headeView = [[YDWFriendHeadView alloc] initWithReuseIdentifier:kYDWFriendHeadViewIndentifer];}headeView.delegte = self;headeView.tag = section;headeView.imageView.image = [self.boolArray[section] boolValue] ? [UIImage imageNamed:[NSString stringWithFormat:@"zhankai"]] : [UIImage imageNamed:[NSString stringWithFormat:@"shouqi"]];headeView.titleLabel.text = self.headerArray[section];headeView.numLabel.text = [NSString stringWithFormat:@"%ld/%lu",(long)section, (unsigned long)[self.dataArray[section] count]];return headeView; }#pragma mark - FriendHeadViewDelegate - (void)friendHeaderReusableView:(YDWFriendHeadView *)friendHeaderReusableView didSelectItemAtSection:(NSInteger)section {if ([self.boolArray[section] boolValue] == YES) {[self.boolArray replaceObjectAtIndex:section withObject:@NO];} else {[self.boolArray replaceObjectAtIndex:section withObject:@YES];}[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:section] withRowAnimation:UITableViewRowAnimationFade]; }#pragma mark - Private Methods - (void)setupNavigation {self.navigationItem.title = @"聯(lián)系人"; }- (void)setupAddTableView {self.tableView.frame = self.view.bounds;[self.view addSubview:self.tableView]; }- (void)getListData {// 準(zhǔn)備組頭的數(shù)據(jù)NSArray *headerArr = [NSArray arrayWithObjects:@"特別關(guān)心", @"我的好友", @"朋友", @"家人",nil];self.headerArray = headerArr;// 準(zhǔn)備單元格的數(shù)據(jù)NSArray *itemArr = [NSArray arrayWithObjects:@5, @10, @7,@3, nil];for (int i = 0; i < self.headerArray.count; i++) {// 所有的分組默認(rèn)關(guān)閉[self.boolArray addObject:@NO];// 給每個(gè)分組添加數(shù)據(jù)NSMutableArray * friendArr = [[NSMutableArray alloc] init];for (int j = 0; j < [itemArr[i] intValue]; j++) {[friendArr addObject:@(j)];}[self.dataArray addObject:friendArr];}[self.tableView reloadData]; }#pragma mark - Lazying Load - (NSMutableArray *)boolArray {if (!_boolArray) {_boolArray = [[NSMutableArray alloc] init];}return _boolArray; }- (NSMutableArray *)dataArray {if (!_dataArray) {_dataArray = [[NSMutableArray alloc] init];}return _dataArray; }- (UITableView *)tableView {if (!_tableView) {_tableView = [[UITableView alloc] init];_tableView.backgroundColor = [UIColor whiteColor];_tableView.showsHorizontalScrollIndicator = NO;_tableView.delegate = self;_tableView.dataSource = self;_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;_tableView.tableFooterView = [UIView new];[_tableView registerClass:[YDWFriendHeadView class] forHeaderFooterViewReuseIdentifier:kYDWFriendHeadViewIndentifer];}return _tableView; }@end
  • YDWFriendHeadView:本類(lèi)主要布局組標(biāo)題以及指示(展開(kāi)/關(guān)閉)控件,其次,通過(guò)添加點(diǎn)擊手勢(shì)結(jié)合委托模式,傳遞tag值。
NS_ASSUME_NONNULL_BEGIN @class YDWFriendHeadView; @protocol FriendHeadViewDelegate <NSObject>- (void)friendHeaderReusableView:(YDWFriendHeadView *)friendHeaderReusableView didSelectItemAtSection:(NSInteger)section;@end@interface YDWFriendHeadView : UITableViewHeaderFooterView@property(nonatomic,weak) id <FriendHeadViewDelegate>delegte;/**圖標(biāo)*/ @property(nonatomic,weak) UIImageView *imageView; /**標(biāo)題*/ @property(nonatomic,weak) UILabel *titleLabel; /**人數(shù)*/ @property(nonatomic,weak) UILabel *numLabel; @endNS_ASSUME_NONNULL_END #import "YDWFriendHeadView.h"@implementation YDWFriendHeadView#pragma mark - 初始化 - (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {if (self = [super initWithReuseIdentifier:reuseIdentifier]) {self.userInteractionEnabled = YES;self.contentView.backgroundColor = [UIColor whiteColor];UITapGestureRecognizer *tapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clickView:)];[self addGestureRecognizer:tapGes];[self addSubviews];}return self; }- (void)awakeFromNib {[super awakeFromNib];[self addSubviews]; }#pragma mark - 設(shè)置UI界面 - (void)addSubviews {// 添加圖標(biāo)UIImageView *imageView = [[UIImageView alloc] init];[self addSubview:imageView];self.imageView = imageView;// 添加標(biāo)題UILabel *titleLabel = [[UILabel alloc] init];titleLabel.font = [UIFont systemFontOfSize:18];titleLabel.textColor = [UIColor darkGrayColor];[self addSubview:titleLabel];self.titleLabel = titleLabel;// 添加人數(shù)UILabel *numLabel = [[UILabel alloc] init];numLabel.font = [UIFont systemFontOfSize:14];numLabel.textAlignment = NSTextAlignmentRight;numLabel.textColor = [UIColor lightGrayColor];[self addSubview:numLabel];self.numLabel = numLabel;}/**調(diào)用父類(lèi)布局子視圖*/ - (void)layoutSubviews {[super layoutSubviews];// 圖標(biāo)self.imageView.frame = CGRectMake(10, 10, 20, 20);// 標(biāo)題CGFloat numW = 60;CGFloat titleX = CGRectGetMaxX(self.imageView.frame) + 10;CGFloat titleW = SCREEN_WIDTH - titleX - numW -15;self.titleLabel.frame = CGRectMake(titleX, 10, titleW, 20);// 人數(shù)CGFloat numX = SCREEN_WIDTH - numW - 10;self.numLabel.frame = CGRectMake(numX, 10, numW, 20); }#pragma mark - 監(jiān)聽(tīng)事件 - (void)clickView:(UITapGestureRecognizer *)tapGes {if ([self.delegte respondsToSelector:@selector(friendHeaderReusableView:didSelectItemAtSection:)]) {[self.delegte friendHeaderReusableView:self didSelectItemAtSection:self.tag];} } @end
  • YDWFriendListShowTableViewCell:主要布局好友信息包括頭像、昵稱(chēng)以及簽名,具體實(shí)現(xiàn)如下:
#import <UIKit/UIKit.h>NS_ASSUME_NONNULL_BEGIN@interface YDWFriendListShowTableViewCell : UITableViewCell@property (weak, nonatomic) IBOutlet UIImageView *headImageView; @property (weak, nonatomic) IBOutlet UILabel *nameLabel; @property (weak, nonatomic) IBOutlet UILabel *signLabel;@endNS_ASSUME_NONNULL_END #import "YDWFriendListShowTableViewCell.h"@implementation YDWFriendListShowTableViewCell- (void)awakeFromNib {[super awakeFromNib];self.headImageView.backgroundColor = [UIColor colorWithRed:arc4random_uniform(256)/255.0 green:arc4random_uniform(256)/255.0 blue:arc4random_uniform(256)/255.0 alpha:1.0];[self.headImageView.layer setMasksToBounds:YES];[self.headImageView.layer setCornerRadius:25];}- (void)setSelected:(BOOL)selected animated:(BOOL)animated {[super setSelected:selected animated:animated];} @end
效果展示:與UICollectionView實(shí)現(xiàn)得的效果一致。
  • 詳細(xì)代碼與具體邏輯見(jiàn)demo:iOS之仿QQ好友列表展開(kāi)收縮效果的實(shí)現(xiàn)。

總結(jié)

以上是生活随笔為你收集整理的iOS之仿QQ好友列表展开收缩效果的实现的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 色哟哟一区二区三区四区 | 美女在线国产 | 色综合色综合 | 国产91在线视频观看 | 对白刺激国产子与伦 | 无码精品久久久久久久 | 午夜福利啪啪片 | 精品国产午夜 | 午夜久久网 | 成人手机在线免费视频 | 日韩一区欧美二区 | 久久一区二区三区四区五区 | 亚洲自拍电影 | 国产乱叫456在线 | 人人澡人人干 | 2019国产精品 | 久久久久亚洲av片无码 | 欧美成年人在线视频 | 欧美影院在线 | 男人的天堂狠狠干 | 亚洲免费视频大全 | 日韩人妻无码精品久久久不卡 | 成人综合av | 国产第8页 | 中文文字幕一区二区三三 | 337p粉嫩日本欧洲亚洲大胆 | 欧美成人自拍 | 饥渴少妇勾引水电工av | 国产麻豆免费视频 | 久久激情久久 | 国产伦精品一区二区三区免费视频 | 日韩看片 | 国内一级黄色片 | 麻豆日韩 | 伊人网综合网 | 婷婷丁香综合网 | 日韩精品视频免费看 | 伊人久久香 | 日日夜夜干 | 欧美jjzz | 亚洲网站一区 | 午夜小影院| 女性裸体视频网站 | 国产 一二三四五六 | 久久国产美女视频 | 欧美成人视| 亚洲视频在线观看免费视频 | 鸥美毛片 | 欧洲美女粗暴牲交免费观看 | 少妇精品 | 操极品| 国产精品美女毛片真酒店 | 成人爱爱免费视频 | 男女做爰猛烈刺激 | 香蕉视频免费 | 国产精品骚 | 日本三级网站在线观看 | 久久爰 | 亚洲福利精品视频 | 国产福利在线导航 | 日韩国产片| 久久中文字幕在线 | 91在线精品一区二区 | 中文字幕.com | 国产全是老熟女太爽了 | 亚洲一区二区偷拍 | 国产精品女人久久久 | 日韩av伦理 | 狠狠爱欧美 | www.国产在线观看 | 手机看片1024国产 | 日啪| 一区二区三区中文字幕在线观看 | 国产欧美日韩亚洲 | 国产三级精品三级在线观看 | 欧美精品手机在线 | www欧美色| 日本黄色录相 | 亚洲精品久久久 | 亚洲成人一二三区 | 国产精品福利一区二区 | 亚洲黄在线 | 色福利在线 | 婷婷五月综合激情 | 男女吻胸做爰摸下身 | 国内成人自拍视频 | 日韩成人在线免费观看 | 在线a| 91精品免费看 | 91视频网| 国产精品成人Av | a√在线观看 | 一级久久久久 | 欧美日韩视频在线观看一区 | 秘密基地电影免费版观看国语 | 中文字幕在线国产 | 国产欧美一级 | 亚洲高h | 超碰凹凸 |