iOS开发杂记

因为记性不好,常常看到点东西,都感觉很好,但是经常时间一长都忘了,所以现在些杂记,记住这些。慢慢补充。

1.iOS屏幕旋转

iOS屏幕旋转可以用系统通知判断方向UIDeviceOrientationDidChangeNotification; 是在屏幕旋转过以后UIApplicationWillChangeStatusBarOrientationNotification;
屏幕没有旋转过的时候调用,可以用系统通知

[[NSNotificationCenter defaultCenter] addObserver:self selector:
@selector(autorotateDirection)name:UIDeviceOrientationDidChangeNotification object:nil];

2.tableView头部偏离问题

最近在用tableView的时候,出现自动偏移了64PX,经过查资料,发现需要设置下

if([selfrespondsToSelector:@selector(edgesForExtendedLayout)])
{
    self.edgesForExtendedLayout= UIRectEdgeNone;
}
[self.navigationController.navigationBar setTranslucent:YES] 

你可能感兴趣的:(iOS开发杂记)