1.UIScrollView
初始化:[[UIScrollView alloc] initWithFrame:CGRectMake(…)];
大小设置:contentSize=CGSizeMake();
垂直条:showsVerticalScrollIndicator
水平条:showsHorizontalScrollIndictor
一页一页的效果:pageEnabled
弹簧效果:bounces=NO
设置scrollView的位置
[XXX setContentOffset:CGPointMake(x, 0) animated:YES]
代理:
#pragma mark 开始拖动滚动条
-(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
#pragma mark 结束滚动滚动条
-(void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
默认的是:NSDefaultRunLoopMode
第二种定时器的创建:
[NSTimer timerWithTimeInterval:2.0 target:self selector:@selector(clickTime) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:self.time forMode:NSRunLoopCommonModes];
NSRunLoopCommonModes:不会受到另外的控件的影响
删除定时器:[self.time invalidate]
页数:numberOfPages
得到最合适的大小;
// 控件尺寸,得到控件最合适的宽度和高度
CGSize size = [_pageControl sizeForNumberOfPages:kCountPic];
不选中按钮的颜色:
pageIndicatorTintColor
选中颜色:
currentPageIndicatorTintColor
当前的页数:
currentPage
初始化:[[UIScrollView alloc] initWithFrame:CGRectMake(…)];
大小设置:contentSize=CGSizeMake();
垂直条:showsVerticalScrollIndicator
水平条:showsHorizontalScrollIndictor
一页一页的效果:pageEnabled
弹簧效果:bounces=NO
设置scrollView的位置
[XXX setContentOffset:CGPointMake(x, 0) animated:YES]
代理:
#pragma mark 开始拖动滚动条
-(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
#pragma mark 结束滚动滚动条
-(void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
2.NSTimer
初始化:[NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(clickTime) userInfo:nil repeats:YES]默认的是:NSDefaultRunLoopMode
第二种定时器的创建:
[NSTimer timerWithTimeInterval:2.0 target:self selector:@selector(clickTime) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:self.time forMode:NSRunLoopCommonModes];
NSRunLoopCommonModes:不会受到另外的控件的影响
删除定时器:[self.time invalidate]
3.UIPageControl
初始化:[UIPageControl alloc] init页数:numberOfPages
得到最合适的大小;
// 控件尺寸,得到控件最合适的宽度和高度
CGSize size = [_pageControl sizeForNumberOfPages:kCountPic];
不选中按钮的颜色:
pageIndicatorTintColor
选中颜色:
currentPageIndicatorTintColor
当前的页数:
currentPage