一、添加文件夹
步骤:
1.在工程文件夹下添加新文件夹
2.右键工程名添加(或直接拖拽至工程)
二、配置状态栏
//设置状态栏样式
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];
//隐藏
// [[UIApplication sharedApplication] setStatusBarHidden:YES];
三、程序书写:从上往下,从底层视图往顶层视图
四、滑动BigScrollView时,不影响SmallScrollView中的timer执行
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
//小ScrollView
if (scrollView.tag == 2)
{
if (_timer !=nil)
{
[_timer invalidate];
_timer = nil;
}
}
//大ScrollView
if (scrollView.tag == 1)
{
//滑动大ScrollView时,定时器的事件正常执行
//需要将定时器添加到当前消息循环中,设置模式为NSRunLoopCommonModes
[[NSRunLoop currentRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes];
}
}
五、UIWebView
Xcode7不支持http请求,所以需要将Xcode7退回到Xcode5,使用http请求。
http协议配置:
2.添加App Transport Security Settings
3.在App Transport Security Settings下添加Allow Arbitrary Loads
4.改为YES
2.<< 二进制位移运算符
//1.平移 缩放 旋转
//UIView上有一个ImageView
//UIView缩放的同时,要求ImageView同时缩放
//需要设置子视图的autoresizingMask属性
// UIViewAutoresizingNone = 0,
// UIViewAutoresizingFlexibleLeftMargin = 1 << 0,
// UIViewAutoresizingFlexibleWidth = 1 << 1,
// UIViewAutoresizingFlexibleRightMargin = 1 << 2,
// UIViewAutoresizingFlexibleTopMargin = 1 << 3,
// UIViewAutoresizingFlexibleHeight = 1 << 4,
// UIViewAutoresizingFlexibleBottomMargin = 1 << 5
//自动布局
//
self.imgView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin |UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin;