(素材源码) 猫猫学iOS 之UIDynamic重力、弹性碰撞吸附等现象牛逼Demo
来源:互联网 发布:linux 文件系统 编辑:程序博客网 时间:2024/06/05 15:56
猫猫分享,必须精品
原创文章,欢迎转载。转载请注明:翟乃玉的博客
地址:http://blog.csdn.net/u013357243
一:效果
二:代码
#import "ViewController.h"#import "DemoViewController.h"@interface ViewController (){ // 功能名称的数组 NSArray *_functions;}@end@implementation ViewController- (void)viewDidLoad{ [super viewDidLoad]; _functions = @[@"吸附行为", @"推动行为", @"刚性附加行为", @"弹性附加行为", @"碰撞检测"];}#pragma mark - 数据源方法- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return _functions.count;}- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ // 使用Storyboard建立的UITabeViewController,其中的Cell是已经注册过的 static NSString *ID = @"Cell"; // 永远都会找到一个单元格,如果缓冲池中没有,会自动新建 /** dequeueReusableCellWithIdentifier 直接查询可重用单元格 dequeueReusableCellWithIdentifier:forIndexPath: 查询“注册的”可重用单元格,此方法中indexPath本身没有用处 * 强制判断是否注册了单元格 如果已经注册过单元格,以上两个方法等效。 如果在StoryBoard中指定了单元格的可重用标示符,单元格的优化将有系统接管,不再需要判断cell == nil */// UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID forIndexPath:indexPath];// if (cell == nil) {// NSLog(@"come here");// // cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];// } cell.textLabel.text = _functions[indexPath.row]; return cell;}#pragma mark - 代理方法- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ DemoViewController *controller = [[DemoViewController alloc] init]; // 指定标题 controller.title = _functions[indexPath.row]; controller.function = indexPath.row; [self.navigationController pushViewController:controller animated:YES];}
#import "DemoViewController.h"#import "DemoView.h"#import "SnapView.h"#import "PushView.h"#import "AttachmentView.h"#import "SpringView.h"#import "CollisionView.h"@interface DemoViewController ()@end@implementation DemoViewController//- (void)loadView//{// self.view = [[DemoView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];//}- (void)viewDidLoad{ [super viewDidLoad]; NSLog(@"功能代号: %d", self.function); // 在此根据实际的功能代号加载实际的视图 DemoView *demoView = nil; switch (self.function) { case kDemoFunctionSnap: demoView = [[SnapView alloc] initWithFrame:self.view.bounds]; break; case kDemoFunctionPush: demoView = [[PushView alloc] initWithFrame:self.view.bounds]; break; case kDemoFunctionAttachment: demoView = [[AttachmentView alloc] initWithFrame:self.view.bounds]; break; case kDemoFunctionSpring: demoView = [[SpringView alloc] initWithFrame:self.view.bounds]; break; case kDemoFunctionCollision: demoView = [[CollisionView alloc] initWithFrame:self.view.bounds]; break; default: break; } [self.view addSubview:demoView];}@end
主要框框就这样啦,贴出了的代码仅仅部分
三:素材代码下载地址
代码上传中。。
12 1
- (素材源码) 猫猫学iOS 之UIDynamic重力、弹性碰撞吸附等现象牛逼Demo
- (素材源码) 猫猫学iOS 之UIDynamic重力、弹性碰撞吸附等现象PS有惊喜
- 猫猫学iOS 之UIDynamic重力、弹性碰撞吸附等现象
- AJ学IOS 之UIDynamic重力、弹性碰撞吸附等现象
- UIDynamic之重力+碰撞+边界
- iOS-UIDynamic物理仿真-重力、碰撞
- UIDynamic之重力行为+碰撞行为
- iOS开发拓展篇—UIDynamic(重力行为+碰撞检测)
- iOS开发拓展篇—UIDynamic(重力行为+碰撞检测)
- iOS开发拓展篇—UIDynamic(重力行为+碰撞检测)
- iOS开发拓展篇—UIDynamic(重力行为+碰撞检测)
- iOS开发拓展篇—UIDynamic(重力行为+碰撞检测)
- iOS重力行为、碰撞行为和吸附(Swift)
- UIDynamic之重力行为
- 【iOS开发-112】UIDynamic物理模拟介绍,如重力行为、碰撞行为、碰撞行为以及其他
- (素材源码)猫猫学IOS(二十六)UI之iOS抽屉效果小Demo
- (素材源码) 猫猫学IOS(五)UI之360等下载管理器九宫格UI
- OS开发拓展篇—UIDynamic(重力行为+碰撞检测)
- Spring MVC XmlViewResolver example
- HDU 4781(图上的构造)
- Myeclipse 安装 gradle 插件以及基本使用
- Leetcode #130 Surrounded Regions
- Git中级用户的25个提示
- (素材源码) 猫猫学iOS 之UIDynamic重力、弹性碰撞吸附等现象牛逼Demo
- JFanal框架介绍
- (素材源码) 猫猫学iOS 之UIDynamic重力、弹性碰撞吸附等现象PS有惊喜
- 最小二乘平差之附有限制条件的间接平差
- 轻松python文本专题-字符与字符值转换
- 函数strstr,strcasestr
- C++笔试总结-面试笔试常考题型(一)指针-引用-宏定义-sizeof
- 封装类之FileVersion(获取文件属性)
- ORACLE-016:ora-01720 授权选项对于'xxxx'不存在