IOS开源项目Coding学习笔记(2):IntroductionViewController (简介View)

 
 
  1. - (void)setupIntroductionViewController{
  2.    IntroductionViewController *introductionVC = [[IntroductionViewController alloc] init];
  3. //    [self.window setRootViewController:[[BaseNavigationController alloc] initWithRootViewController:introductionVC]];
  4.    [self.window setRootViewController:introductionVC];
  5. }

介绍界面的分析:


 
 
  1. @interface IntroductionViewController : IFTTTAnimatedPagingScrollViewController
  2. @end

继承自IFTTTAnimatedPagingScrollViewController一个开源的ios动画类库JazzHands,具体可以参考:https://github.com/IFTTT/JazzHands


1、登录和注册按钮

学习第三方Auto LayoutMasonry的初步使用

https://github.com/SnapKit/Masonry

http://draveness.me/ios-yuan-dai-ma-fen-xi-masonry/


2、

学习了解ios适配的初步东西,这部分比较复杂,暂时也不是特别清楚

http://blog.csdn.net/phunxm/article/details/42174937


3、两个判断是否是iphone6和6s的宏

 
 
  1. #define kDevice_Is_iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)

4、

几个有关屏幕宽高的宏:

 
 
  1. #define kScreen_Bounds [UIScreen mainScreen].bounds
  2. #define kScreen_Height [UIScreen mainScreen].bounds.size.height
  3. #define kScreen_Width [UIScreen mainScreen].bounds.size.width

5、

Objective C类方法load和initialize的区别

 
 
  1. + (void)initialize
  2. {
  3. NSString *reqSysVer = @"7.0";
  4. NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
  5. if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending) {
  6. _defaultStyleForSystemVersion = SMPageControlDefaultStyleModern;
  7. } else {
  8. _defaultStyleForSystemVersion = SMPageControlDefaultStyleClassic;
  9. }
  10. }

参考:

http://www.cnblogs.com/ider/archive/2012/09/29/objective_c_load_vs_initialize.html

http://justsee.iteye.com/blog/1630979


6、https://github.com/Spaceman-Labs/SMPageControl 开源项目

 
 
  1. SMPageControl

页面指示器

ios原生控件:UIPageControl


7、按钮注册点击事件

 
 
  1. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
  2.        [button addTarget:self action:@selector(loginBtnClicked) forControlEvents:UIControlEventTouchUpInside];

响应处理:

 
 
  1. #pragma mark Action
  2. - (void)registerBtnClicked{
  3.    RegisterViewController *vc = [[RegisterViewController alloc] init];
  4.    UINavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:vc];
  5.    [self presentViewController:nav animated:YES completion:nil];
  6. }
  7. - (void)loginBtnClicked{
  8.    LoginViewController *vc = [[LoginViewController alloc] init];
  9.    vc.showDismissButton = YES;
  10.    UINavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:vc];
  11.    [self presentViewController:nav animated:YES completion:nil];
  12. }

进入另一个试图控制器:

 
 
  1. [self presentViewController:nav animated:YES completion:nil];


总结:这个界面主要有翻页 ,页面指示器, 外加底部的两个按钮组成


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值