一、cardGroups 界面?
? ? ? 每個cell上蓋一個同等的btn按鈕,然后有左滑刪除,這兩個事件會有沖 ? 突。 把cell上的button改為手勢 就解決了這個問題。。
二、 UIViewController的轉(zhuǎn)屏方法 ,調(diào)整控件的frame:
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
if (toInterfaceOrientation == UIInterfaceOrientationPortrait) {
self.view.backgroundColor = [UIColor whiteColor];
[self.playerView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.view).offset(0);
}];
if (m_imageView) {
[m_imageView setFrame:CGRectMake(0, 0, screen, screen*9/16.0)];
[bottomImageView setFrame:CGRectMake(0, m_imageView.height-50, m_imageView.width, 50)];
[textLabel setFrame:CGRectMake(0, 0, bottomImageView.width, 50)];
}
if(backViewB){
[backViewB setFrame:CGRectMake(0, 0, screen, screen*9/16.0)];
[photoView setFrame:CGRectMake(0, 0, backViewB.frame.size.width, backViewB.frame.size.height)];
_playButton.frame = CGRectMake(screen/2-40, screen*9/16.0*9/16-65, 80, 80);
}
}else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight || toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
self.view.backgroundColor = [UIColor blackColor];
}
三、設(shè)置這個項目哪些頁面支持自動轉(zhuǎn)屏

? ? ? ? ?設(shè)置整個app支持方向;
? ? ? ? MyNavigationViewController 繼承UINavigationController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
//設(shè)置默認導(dǎo)航字體顏色
[self.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor colorWithHexString:@""],NSForegroundColorAttributeName,nil]];
}
// 哪些頁面支持自動轉(zhuǎn)屏
-(BOOL)shouldAutorotate{
if ([self.viewControllers.lastObject.class isSubclassOfClass:[VideoViewController class]] ) {
return ![ZFPlayerSingleton sharedZFPlayer].isLockScreen;
}else if ([self.viewControllers.lastObject.class isSubclassOfClass:[VodViewController class]]){
return ![ZFPlayerSingleton sharedZFPlayer].isLockScreen;
}
return NO;
}
// viewcontroller支持哪些轉(zhuǎn)屏方向
-(UIInterfaceOrientationMask)supportedInterfaceOrientations{
if ([self.viewControllers.lastObject.class isSubclassOfClass:[VideoViewController class]]) {
return UIInterfaceOrientationMaskAll;
}else if ([self.viewControllers.lastObject.class isSubclassOfClass:[VodViewController class]]){
return UIInterfaceOrientationMaskAll;
}
return UIInterfaceOrientationMaskPortrait;
}