zoukankan      html  css  js  c++  java
  • 学习IOS开发UI篇--UI知识点总结(三) UIScrollView/UIPageControl/NSTimer

      UIScrollView:常用属性

    @property(nonatomic)   UIEdgeInsets     contentInset;               // default UIEdgeInsetsZero. add additional scroll area around content

    @property(nonatomic,getter=isPagingEnabled) BOOL   pagingEnabled;     // default NO. if YES, stop on multiples of view bounds

    @property(nonatomic)         BOOL   showsHorizontalScrollIndicator; // default YES. show indicator while we are tracking. fades out after tracking

    @property(nonatomic)         BOOL   showsVerticalScrollIndicator;   // default YES. show indicator while we are tracking. fades out after tracking

    @property(nonatomic) CGFloat minimumZoomScale;     // default is 1.0 (缩放属性)

    @property(nonatomic) CGFloat maximumZoomScale;     // default is 1.0. must be > minimum zoom scale to enable zooming

      常用代理方法

    - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView;     // return a view that will be scaled. if delegate returns nil, nothing happens (实现缩放)

    - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView; //

    - (void)scrollViewDidScroll:(UIScrollView *)scrollView;  //滚动时执行

    - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate;

      UIPageControl:常用属性 (一般配合NSTimer使用)

    @property(nonatomic) NSInteger numberOfPages;     

    @property(nonatomic) NSInteger currentPage; 

      NSTimer:常用方法

    - (void)invalidate; 当屏幕被手动滚动的时候应该让timer失效, [timer invalidate],然后清空timer = nil;

    当滚动停止的时候再创建timer,设置

    + (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)yesOrNo; (次方法在多滚动试图中,只能滚动一个)

    + (NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)yesOrNo; (此方法需要配合NSRunLoop使用)

    NSRunLoop的对象方法调用者是  [NSRunLoop main]

    - (void)addTimer:(NSTimer *)timer forMode:(NSString *)mode;

    timer 传入上方法返回的对象

    mode 传入NSRunLoopCommonModes

  • 相关阅读:
    快速挂载和分离VHD文件的小脚本
    开机自动挂载 VHD 的方法
    搭建属于你自己的RAMOS系统 – WIN7+VHD+GURB map方式
    去除右键的opendgl
    为XYplorer添加右键菜单:“使用XYplorer打开”
    用VB把xls转换为xlsx
    用VB把xlsx转换为xls
    把Excel工作簿的每个工作表提取出来保存为新工作簿
    (转载)uefi启动解析:由原理到实例
    理想中的SQL语句条件拼接方式 (二)
  • 原文地址:https://www.cnblogs.com/zhaoyan/p/3763317.html
Copyright © 2011-2022 走看看