你的位置:首页 > 软件开发 > 操作系统 > iOS开发 tableView点击下拉扩展 + 内嵌collectionView上传图片效果

iOS开发 tableView点击下拉扩展 + 内嵌collectionView上传图片效果

发布时间:2016-04-13 11:00:13
---恢复内容开始---//需要的效果 1.设置window的根视图控制器为一个UITableViewController#import "AppDelegate.h"#import "YCTableViewController.h"@ ...

iOS开发 tableView点击下拉扩展 + 内嵌collectionView上传图片效果

---恢复内容开始---

//需要的效果

iOS开发 tableView点击下拉扩展 + 内嵌collectionView上传图片效果

 

1.设置window的根视图控制器为一个UITableViewController

#import "AppDelegate.h"@implementation AppDelegate

2.UITableViewController

//  Copyright © 2016年 Chason. All rights reserved.#import <UIKit/UIKit.h>@end

//  Copyright © 2016年 Chason. All rights reserved.#import "YCTableViewController.h"@end@implementation YCTableViewController- (void)viewDidLoad {- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath//对照片进行处理-(void)textfiledShow//弹框提示相片来源- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section#pragma mark 头视图size-(CGFloat)lengthWithString:(NSString *)string-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath- (void)showDetail:(UITapGestureRecognizer *)tap@end3.自定义tableview的header和cell

//header

//  Copyright © 2016年 Chason. All rights reserved.#import <UIKit/UIKit.h>@interface DepositFeeHeader : UITableViewHeaderFooterView#import "DepositFeeHeader.h"- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier@end

//cell

//  Copyright © 2016年 Chason. All rights reserved.#import <UIKit/UIKit.h>@interface DepositFeeWithApplyTableViewCell : UITableViewCell#import "DepositFeeWithApplyTableViewCell.h"- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier//添加虚线框@end

4.collectionView布局和自定义item

#import <UIKit/UIKit.h>@interface SectionHeaderViewCollectionReusableView : UICollectionReusableView@implementation SectionHeaderViewCollectionReusableView-(void)createViews-(void)layoutSubviews@end

collectionView的item

#import <UIKit/UIKit.h>@interface MyCollectionViewCell : UICollectionViewCell@property(nonatomic, assign)CollectionViewCellStyle cellStyle;@implementation MyCollectionViewCell-(void)layoutSubviews5.model

#import <Foundation/Foundation.h>@interface AppModel : NSObject@implementation AppModel@end

//设置model是为了设置一个bool类型的变量,用来记录tableview的cell是否展开,从而进行reloadSection操作,进行动画展开或收缩.

 

---恢复内容结束---


 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:iOS开发 tableView点击下拉扩展 + 内嵌collectionView上传图片效果

关键词:IOS

IOS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。