correct landscape host view well device sensor is portrait
This commit is contained in:
1 parent
565e31983c
commit
00d89f12e8
1 file changed
+16
-3
@@ -1014,9 +1014,8 @@ static NSMutableSet* hostList;
|
|||||||
|
|
||||||
- (void)viewDidLoad
|
- (void)viewDidLoad
|
||||||
{
|
{
|
||||||
//[OrientationHelper updateOrientationToLandscape];
|
|
||||||
|
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
|
//[OrientationHelper updateOrientationToLandscape];
|
||||||
[self attachWaterMark];
|
[self attachWaterMark];
|
||||||
#if !TARGET_OS_TV
|
#if !TARGET_OS_TV
|
||||||
_settingsExpandedInStreamView = false; // init this flag
|
_settingsExpandedInStreamView = false; // init this flag
|
||||||
@@ -1076,7 +1075,21 @@ static NSMutableSet* hostList;
|
|||||||
_boxArtCache = [[NSCache alloc] init];
|
_boxArtCache = [[NSCache alloc] init];
|
||||||
|
|
||||||
hostScrollView = [[ComputerScrollView alloc] init];
|
hostScrollView = [[ComputerScrollView alloc] init];
|
||||||
hostScrollView.frame = CGRectMake(0, self.navigationController.navigationBar.frame.origin.y + self.navigationController.navigationBar.frame.size.height, self.view.frame.size.width, self.view.frame.size.height / 2);
|
|
||||||
|
CGFloat screenWidthInPoints = CGRectGetWidth([[UIScreen mainScreen] bounds]);
|
||||||
|
CGFloat screenHeightInPoints = CGRectGetHeight([[UIScreen mainScreen] bounds]);
|
||||||
|
|
||||||
|
bool isLandscape = screenWidthInPoints > screenHeightInPoints;
|
||||||
|
NSLog(@"isLandscape1 %d", isLandscape);
|
||||||
|
CGFloat realViewFrameWidth = self.view.frame.size.width > self.view.frame.size.height ? self.view.frame.size.width : self.view.frame.size.height;
|
||||||
|
CGFloat realViewFrameHeight = self.view.frame.size.width < self.view.frame.size.height ? self.view.frame.size.width : self.view.frame.size.height;
|
||||||
|
if(!isLandscape) {
|
||||||
|
CGFloat tmpLength = realViewFrameWidth;
|
||||||
|
realViewFrameWidth = realViewFrameHeight;
|
||||||
|
realViewFrameHeight = tmpLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
hostScrollView.frame = CGRectMake(0, self.navigationController.navigationBar.frame.origin.y + self.navigationController.navigationBar.frame.size.height, realViewFrameWidth, realViewFrameHeight / 2);
|
||||||
[hostScrollView setShowsHorizontalScrollIndicator:NO];
|
[hostScrollView setShowsHorizontalScrollIndicator:NO];
|
||||||
hostScrollView.delaysContentTouches = NO;
|
hostScrollView.delaysContentTouches = NO;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user