16其他UI内容

来源:互联网 发布:如何雇佣网络水军 编辑:程序博客网 时间:2024/04/23 22:09
    1. UIDynamic是物理引擎,模仿物理效果
    2. 知名2D物理引擎 Box2d Chipmunk
    3. 只有遵守了UIDynamicItem协议的对象

    UIVIew默认遵守了协议

    UICollectionViewLayouetAttributes已经遵循了

    1. 重力行为

    UIGravityBehavior   重力行为

    UICollisionBehavior碰撞行为

     

     

    1. UIDynamicAnimator *animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view];

    UIGravityBehavior  *grivity = [[UIGravityBehavior alloc] initWithItems:@[self.myView];

    grivity.gravityDirection = CGVectorMake( ,);

    grivity.angle = 0;弧度方向 跟上面的设置有矛盾,哪个在下面哪个起作用M_PI_2

    grivity.magnitude = 1; 设置重力加速度  gravityDiretion有矛盾

    [animator addBehavior:grivity];

     

    1. 弹性行为UICollisionBehavior *collision = [[UICollisionBehavior alloc] initWithItems:--];

    collision.translatesRefrernceBoundsIntoBoundary = YES;

    [self.animator addBehavior:collision];

    UIDynamicItemBehavior *item =UIDynamicItemBehavior alloc] initWithItems:@[self.myView]];辅助行为

    item.resistance = 1;阻力

    item.elasticity = 0.5;弹性系数

     

    1. 通常用辅助行为来设置弹性系数

    只要是行为就要添加

    1. [collision addBoundaryWithIdentifier:@"c1" fromePoint:CGPointMake   toPoint;自定义一条线为边界
    2. UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(20, 300, 400, 150)];

    [collision addBoundaryWithIdentifier:@"c2" forPath:path];

     

    1. 检测碰到的是哪一根线 设置代理<UICollisionDelegate>

    collision.collisionDelegate = self;

    • (void)collisionBehavior -------withBoundaryIdentifier当碰撞的时候就会调用

    beganContactForItem:标示碰撞的物体

    identifier:标示边界的标示符

    atPoint:标示碰撞的点

     

    UIView *view = (UIView*) item; 要强转

     

    1. 碰撞模式

    collision.collisionMode = UICollisionBehaviiorModeItems; 只和物体碰撞

    Boundaries只和边界碰撞

    everything都碰撞

     

    1. item.allowsrotation = YES 是否旋转 
    2. 捕捉行为  UISnapBehavior *snap = [[UISnapBehavior alloc]initWithItem:self.myView snapToPoint:CGPoint];   比如移动到手指所触摸的点

    阻力系数snap.damping = 0.5; 取值范围是0.5~1; 默认应该是0.5

     

    1. 附着行为 需要重力行为initWIthitem:标示产生附着行为的物体 attachedToAnchor:附着的点 没有重力行为附着行为没效果

    UIAttachmentBehavior *attachment = [[UIAttachmentBehavior alloc] initWithItem:self.myView attachedToAnchor:point];

     

    1. 只要重力行为有效果,就会调用 [ --- setAction:^{ 可以在这个方法中划线 }];
    2. 自定义了viewCZView 在控制器要获取相应的定义的变量要强转CZView = (CZView *)self.view;
    3. attachiment.damping = 0.5 阻尼系数

    attachiment.frequency = 0.5频率

    attachiment.length 是附着点和中心点得距离

    1. 中心点偏移的改变

    UIAttachmentBehavior *attachment = [[UIAttachmentbehavior alloc] initWithItem:@[self.myView] offsetFromCenter:UIOffset attachedToAnchor:CGPoint];

     

    1.  推力行为[self.view converPoint:(CGPoint) fromView:(UIView*)];  fromView中的点坐标转换成self.view的点坐标。
    2. UIPushBehavior *push = [[UIPushBehavior alloc] initWithItems:@[] mode:UIPushBehaviorMode Continuous];  Insantaneous  一次性会回去

    触摸点 物体的中心点进行计算 加速度方向

    方向 push.pushDirection = CGVectorMake(pushX, pushY);

    加速度  push.magnitude = sqrt();

     

    1. [NSURL fileURLWithPath:]本地资源

    [NSURL urlWith:http://]网络资源

     

    1. 改变原来附着点得锚点就可以移动原来的画面了

    self.attachment.anchorPoint = point;

     

    1. 移除附着点

    [self.animator remove ----];

     

    1. 自定义layer 中要创建layer 用的方法是-(void)drawInContext:(CGContextRef)ctx{};

    记住在自定义中的地方要重绘。[layer setNeedsDisplay]  view也有这个方法

    代理或者继承都要重绘

     

    1. 通过代理方法也可以在控制器中进行绘制图形 创建layer

     

    1. keyAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];中间快两边慢
      1. UIDynamic是物理引擎,模仿物理效果
      2. 知名2D物理引擎 Box2d Chipmunk
      3. 只有遵守了UIDynamicItem协议的对象

      UIVIew默认遵守了协议

      UICollectionViewLayouetAttributes已经遵循了

      1. 重力行为

      UIGravityBehavior   重力行为

      UICollisionBehavior碰撞行为

       

       

      1. UIDynamicAnimator *animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view];

      UIGravityBehavior  *grivity = [[UIGravityBehavior alloc] initWithItems:@[self.myView];

      grivity.gravityDirection = CGVectorMake( ,);

      grivity.angle = 0;弧度方向 跟上面的设置有矛盾,哪个在下面哪个起作用M_PI_2

      grivity.magnitude = 1; 设置重力加速度  gravityDiretion有矛盾

      [animator addBehavior:grivity];

       

      1. 弹性行为UICollisionBehavior *collision = [[UICollisionBehavior alloc] initWithItems:--];

      collision.translatesRefrernceBoundsIntoBoundary = YES;

      [self.animator addBehavior:collision];

      UIDynamicItemBehavior *item =UIDynamicItemBehavior alloc] initWithItems:@[self.myView]];辅助行为

      item.resistance = 1;阻力

      item.elasticity = 0.5;弹性系数

       

      1. 通常用辅助行为来设置弹性系数

      只要是行为就要添加

      1. [collision addBoundaryWithIdentifier:@"c1" fromePoint:CGPointMake   toPoint;自定义一条线为边界
      2. UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(20, 300, 400, 150)];

      [collision addBoundaryWithIdentifier:@"c2" forPath:path];

       

      1. 检测碰到的是哪一根线 设置代理<UICollisionDelegate>

      collision.collisionDelegate = self;

      • (void)collisionBehavior -------withBoundaryIdentifier当碰撞的时候就会调用

      beganContactForItem:标示碰撞的物体

      identifier:标示边界的标示符

      atPoint:标示碰撞的点

       

      UIView *view = (UIView*) item; 要强转

       

      1. 碰撞模式

      collision.collisionMode = UICollisionBehaviiorModeItems; 只和物体碰撞

      Boundaries只和边界碰撞

      everything都碰撞

       

      1. item.allowsrotation = YES 是否旋转 
      2. 捕捉行为  UISnapBehavior *snap = [[UISnapBehavior alloc]initWithItem:self.myView snapToPoint:CGPoint];   比如移动到手指所触摸的点

      阻力系数snap.damping = 0.5; 取值范围是0.5~1; 默认应该是0.5

       

      1. 附着行为 需要重力行为initWIthitem:标示产生附着行为的物体 attachedToAnchor:附着的点 没有重力行为附着行为没效果

      UIAttachmentBehavior *attachment = [[UIAttachmentBehavior alloc] initWithItem:self.myView attachedToAnchor:point];

       

      1. 只要重力行为有效果,就会调用 [ --- setAction:^{ 可以在这个方法中划线 }];
      2. 自定义了viewCZView 在控制器要获取相应的定义的变量要强转CZView = (CZView *)self.view;
      3. attachiment.damping = 0.5 阻尼系数

      attachiment.frequency = 0.5频率

      attachiment.length 是附着点和中心点得距离

      1. 中心点偏移的改变

      UIAttachmentBehavior *attachment = [[UIAttachmentbehavior alloc] initWithItem:@[self.myView] offsetFromCenter:UIOffset attachedToAnchor:CGPoint];

       

      1.  推力行为[self.view converPoint:(CGPoint) fromView:(UIView*)];  fromView中的点坐标转换成self.view的点坐标。
      2. UIPushBehavior *push = [[UIPushBehavior alloc] initWithItems:@[] mode:UIPushBehaviorMode Continuous];  Insantaneous  一次性会回去

      触摸点 物体的中心点进行计算 加速度方向

      方向 push.pushDirection = CGVectorMake(pushX, pushY);

      加速度  push.magnitude = sqrt();

       

      1. [NSURL fileURLWithPath:]本地资源

      [NSURL urlWith:http://]网络资源

       

      1. 改变原来附着点得锚点就可以移动原来的画面了

      self.attachment.anchorPoint = point;

       

      1. 移除附着点

      [self.animator remove ----];

       

      1. 自定义layer 中要创建layer 用的方法是-(void)drawInContext:(CGContextRef)ctx{};

      记住在自定义中的地方要重绘。[layer setNeedsDisplay]  view也有这个方法

      代理或者继承都要重绘

       

      1. 通过代理方法也可以在控制器中进行绘制图形 创建layer

       

      1. keyAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];中间快两边慢
      1. toolBar要设置高度要不然是透明的
      2. NSIndexPath *path = [self.tableView indexPathForSelectedRow];
      3. json解析

      1.获取路径转成 NSData 2进制

      NSData *data = [NSData dataWithContentsOfFile:path];

      2.第二个参数返回可变的容器 数组或者字典

      [NSJSONSerialization JSONObjectWithData:data options:NSJONReadingMutableCont

      3.再就和plist一样

    ainers error:返回错误的指针

    忽略警告方法

      1. 新特性应该以沙盒中和手机版本号进行比较
      2. 更新的时候沙盒的东西是不变的
      3. 获取info.plist 

      NSDictionary * idct = [NSBundle mainBundle].infoictionary;

      1. 查看key右键info.plist查看源代码  [UIApplication shareApplication].keyWindow
        • [UIApplication shareApplication].window

          self.view.window当前view所在的window

          1. webView加载网页

          NSURL *url = [NSURL URLWithString:@"http://www.baidu.com"];ios9默认不允许加载http 只允许https

           

          家在本地的是

          NSURL *url = [NSBundle mainBundle] URLForResource:@"help.html", withExtension

          NSURLRequest *req = [NSURLRequest requestWithURL:url];

          [webView loadRequest:req];

           

           

           

           

          计算机生成了可选文字:roller, h bar. m let. h Jer. m •oller,h oller.m ler.h oller.m Iler.h Iler.m rooer.h Information Property List NSAppTrensportSecurity NSA] lowshbitrarycoads CÉBundleOevesopmentiRegion CFBundleExecutable CFgundleaentitier CFeundlent00ictionaryversion CFeutwe,Name CFOund1epacogeryøe CFBundleShortversionstring CFBundle:Sjgnature CFBundleVersion LSRequireslPhoneOS UIRequiredDeviceCapabilities Type Dictionary Dictionary Boolean String String String String string string String String String Boolean Array Value (14 items) (1 item) $(PROOUCT-BUNOLE-JDENTIFIER) SOROOUCT-NAME) 1.0 YES (1 itemJ

           

           

           

           

          计算机生成了可选文字:Transport Security v NSAppTransportSecurity NSAllowsArbitraryLoads NSAPPTransportSecutity baik@baidu.com NSIncludesSubdomains Dictionary Boolean (1 item) (1 vtem) iten•vs) TLSv1.1 (1 item) YES Dictionary Octjona,ry Octionary c csou NSTemporaryExceptionAIlowslnsecweH TTP Loads NSTompora Minim String What/ s New in iOS9 NSURLSesSiOn/NSIJRLConnection HTTP load failed

        window.onload= function(){

         

        document.location.href= '#xl';

         

        }

         

        1. 加载网页是在加载网页之后delegate
        • (void)webViewDidFinishLoad:(UIWebView *)webView{};
        1. webView去执行js代码
        2. NSString *code = @"document.location.href = '#xl';

        [webView stringByEvaluatingJavaScriptFromString:code];

        5.bundle display name改名字

        1. 改名字要新建strings 名字是InfoPlist.strings
        2. gitHub搜索ios-system
        3. 想看字典里边的内容 [dict description];
        4. 计算机生成了可选文字:/ / 1 . 添 加 项 目 对 语 言 的 支 持 / / 2. 创 建 一 个 叫 的 文 件 ( 名 字 不 要 乱 起 ) / / 3. 点 击 InfoPtist.strings 点 右 上 角 文 件 图 片 勾 选 中 英 文 / / 4 . 这 时 候 InfoPIist 、 st ngs 左 侧 会 有 箭 头 屐 开 5 . 在 中 文 和 英 文 的 strings 的 文 件 下 写 key value 格 式 : 6.key 是 在 info.plistÄ 实 的 key value 就 是 要 显 示 的 值
        5. residemenu 侧滑菜单 qq

         



0 0
原创粉丝点击