您的位置:首页 > 其它

彩票项目总结

2016-03-06 13:47 253 查看
1. 重写该方法,取消按钮点击时的黑暗效果

- (void)setHighlighted:(BOOL)highlighted {

}

2. kImageCount 为 5,当self.pageControl.currentPage 递增时 index只会产生 0 ~ 4 的数字

NSInteger index = (self.pageControl.currentPage + 1) % kImageCount;

3. 获得屏幕宽高

CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;

CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;

4. - (void)touchesMoved:(NSSet<UITouch *>
*)touches withEvent:(UIEvent *)event
UITouch *touch = [touchesanyObject];

CGPoint current = [touch locationInView:self.view]; // 获取当前点

CGPoint previous = [touch previousLocationInView:self.view];// 获取上一个点

5. 加了运行循环(NSRunLoopCommonModes: 如果是NSDefaultRunLoopMode的话还是影响)之后, 再拖动文字 将不再影响self.timer 的工作情况

[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];

6.
[self.window bringSubviewToFront:self.view2]; // 将self.view2 放到self.window的子视图的最上面
[self.window sendSubviewToBack:self.view2]; // 将self.view2 放到self.window子视图的最下面

7. 根据图片数自适应 pageControl的 size

CGSize size = [_pageControl sizeForNumberOfPages:_pageControl.numberOfPages];

8. 第一次使用这个类
或者子类的时候调用

+ (void)initialize
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: