CGRect rect = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 64); UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphi.....
分类:
其他好文 时间:
2016-01-19 10:28:10
阅读次数:
148
-(UIImage *)captureScreenWithRect:(CGRect)rect{ UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, 1); [self.view.layer renderInCont.....
分类:
移动开发 时间:
2016-01-19 10:16:44
阅读次数:
204
注意index不要出现out of bounds的情况:代码:public class Solution { public int[] searchRange(int[] nums, int target) { int len = nums.length; int ...
分类:
其他好文 时间:
2016-01-17 06:29:48
阅读次数:
182
第一种:CGFloat width = CGRectGetWidth([[UIScreen mainScreen] bounds]);CGFloat aspectRatio = 1.5;maker.width.equalTo(width);maker.height.equalTo(aspectRat...
分类:
其他好文 时间:
2016-01-16 11:48:17
阅读次数:
131
1. frame与bounds的区别:frame是从屏幕的左上角开始计算位置,而bounds是从新添加view左上角作为(0,0)开始计算bounds是以自身为参考系,所以左上角的点为原点center坐标参照父视图坐标系2. iOS启动流程:从main方法开始:NSStringFromClass([...
分类:
其他好文 时间:
2016-01-15 16:03:51
阅读次数:
157
UIScrollView底层实现:修改bounds,就等于UIScrollView的contentOffset偏移量#import "ViewController.h" @interface ViewController () @property (nonatomic, weak) UIView *...
分类:
其他好文 时间:
2016-01-15 06:19:31
阅读次数:
195
#import "ViewController.h"#import "YZUIScrollView.h"#define kuan ([UIScreen mainScreen].bounds.size.width+20)#define gao [UIScreen mainScreen].bounds....
分类:
移动开发 时间:
2016-01-13 21:52:03
阅读次数:
296
#import"ViewController.h"#definekuan[UIScreenmainScreen].bounds.size.width#definegao[UIScreenmainScreen].bounds.size.height@interfaceViewController()<UIScrollViewDelegate>@property(weak,nonatomic)IBOutletUIScrollView*huaKuang;@end@implementationViewCo..
分类:
移动开发 时间:
2016-01-13 00:52:00
阅读次数:
375
#import "ViewController.h"#define kuan [UIScreen mainScreen].bounds.size.width#define gao [UIScreen mainScreen].bounds.size.height@interface ViewContr...
分类:
移动开发 时间:
2016-01-12 23:06:11
阅读次数:
377
iOS SDK不希望开发者通过修改frame的办法来移动视图,而推荐设置视图的center属性。autoresizesSubviews:当视图的bounds发生变化时,其子视图是否会自动缩放。autoresizingMask:当上级视图的bounds有变化时,本视图应该如何响应。如果视图处在约束系统...
分类:
移动开发 时间:
2016-01-12 01:08:19
阅读次数:
293