沖突事件和橫豎屏轉(zhuǎn)換

一、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;

}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容