设为首页 加入收藏

TOP

iOS开发 tableView点击下拉扩展 + 内嵌collectionView上传图片效果(一)
2017-10-13 10:17:03 】 浏览:3422
Tags:iOS 开发 tableView 点击 下拉 扩展 内嵌 collectionView 上传 图片 效果

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

//需要的效果

 

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

#import "AppDelegate.h"
#import "YCTableViewController.h"
@interface AppDelegate ()
@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor whiteColor];
    self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[YCTableViewController alloc] init]];
    [self.window makeKeyAndVisible];
    return YES;
}

2.UITableViewController

//  Copyright © 2016年 Chason. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DepositFeeHeader.h"
#import "DepositFeeWithApplyTableViewCell.h"
#import "AppModel.h"
#import "MyCollectionViewCell.h"
#import "SectionHeaderViewCollectionReusableView.h"
@interface YCTableViewController : UITableViewController<UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIImagePickerControllerDelegate, UIActionSheetDelegate, UINavigationControllerDelegate>
@property (nonatomic, strong) NSMutableArray *dataArray;
@property (nonatomic, strong) NSMutableArray *ownHobby;//上传图片数组1
@property (nonatomic, strong) NSMutableArray *imageArray;//上传图片数组2
@property (nonatomic, strong) UICollectionView *collection;
@property (nonatomic, strong) UIActionSheet *actionSheet;
@property (nonatomic, strong) AppModel *model;
@property (nonatomic, assign) NSInteger reUpdate;
@property (nonatomic, strong) NSString *imageString;
@property (nonatomic, assign) NSInteger number;

@end

//  Copyright © 2016年 Chason. All rights reserved.
//

#import "YCTableViewController.h"
//手机屏幕的宽和高
#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define KScreenHeight [UIScreen mainScreen].bounds.size.height
@interface YCTableViewController ()

@end

@implementation YCTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _dataArray = [[NSMutableArray alloc] initWithCapacity:1];
    for (int i = 0; i < 3; i++) {
        AppModel *model = [[AppModel alloc] init];
        [_dataArray addObject:model];
    }
    _ownHobby = [NSMutableArray array];
    _reUpdate = 10000;//赋初值
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    AppModel *model = _dataArray[section];
    if ([model Is_Open]) {
        return 1;
    }else
    {
        return 0;
    }
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    [_ownHobby removeAllObjects];
    for (int i = 0; i < _dataArray.count; i++) {
        _imageArray= [NSMutableArray a

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 1/11/11
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇核心动画——弹簧动画二 下一篇【代码笔记】iOS-禁止输入表情符号

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目