mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-04-16 13:30:14 +00:00
Allow the settings view to scroll on smaller iPhones
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
@property (strong, nonatomic) IBOutlet UISegmentedControl *resolutionSelector;
|
@property (strong, nonatomic) IBOutlet UISegmentedControl *resolutionSelector;
|
||||||
@property (strong, nonatomic) IBOutlet UISegmentedControl *onscreenControlSelector;
|
@property (strong, nonatomic) IBOutlet UISegmentedControl *onscreenControlSelector;
|
||||||
@property (strong, nonatomic) IBOutlet UISegmentedControl *remoteSelector;
|
@property (strong, nonatomic) IBOutlet UISegmentedControl *remoteSelector;
|
||||||
|
@property (strong, nonatomic) IBOutlet UIScrollView *scrollView;
|
||||||
|
|
||||||
- (void) saveSettings;
|
- (void) saveSettings;
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,33 @@
|
|||||||
}
|
}
|
||||||
static NSString* bitrateFormat = @"Bitrate: %.1f Mbps";
|
static NSString* bitrateFormat = @"Bitrate: %.1f Mbps";
|
||||||
|
|
||||||
- (void)viewDidAppear:(BOOL)animated
|
-(void)viewDidLayoutSubviews {
|
||||||
{
|
// On iPhone layouts, this view is rooted at a ScrollView. To make it
|
||||||
[super viewDidAppear:animated];
|
// scrollable, we'll update content size here.
|
||||||
|
if (self.scrollView != nil) {
|
||||||
|
CGFloat highestViewY = 0;
|
||||||
|
|
||||||
|
// Enumerate the scroll view's subviews looking for the
|
||||||
|
// highest view Y value to set our scroll view's content
|
||||||
|
// size.
|
||||||
|
for (UIView* view in self.scrollView.subviews) {
|
||||||
|
// UIScrollViews have 2 default UIImageView children
|
||||||
|
// which represent the horizontal and vertical scrolling
|
||||||
|
// indicators. Ignore these when computing content size.
|
||||||
|
if ([view isKindOfClass:[UIImageView class]]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
CGFloat currentViewY = view.frame.origin.y + view.frame.size.height;
|
||||||
|
if (currentViewY > highestViewY) {
|
||||||
|
highestViewY = currentViewY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add a bit of padding so the view doesn't end right at the button of the display
|
||||||
|
self.scrollView.contentSize = CGSizeMake(self.scrollView.contentSize.width,
|
||||||
|
highestViewY + 20);
|
||||||
|
}
|
||||||
|
|
||||||
// Adjust the subviews for the safe area on the iPhone X.
|
// Adjust the subviews for the safe area on the iPhone X.
|
||||||
if (!_adjustedForSafeArea) {
|
if (!_adjustedForSafeArea) {
|
||||||
|
|||||||
@@ -185,6 +185,7 @@
|
|||||||
<outlet property="onscreenControlSelector" destination="WGf-9d-eAm" id="hob-se-4Sn"/>
|
<outlet property="onscreenControlSelector" destination="WGf-9d-eAm" id="hob-se-4Sn"/>
|
||||||
<outlet property="remoteSelector" destination="FyK-g5-ohw" id="E6P-WS-0qb"/>
|
<outlet property="remoteSelector" destination="FyK-g5-ohw" id="E6P-WS-0qb"/>
|
||||||
<outlet property="resolutionSelector" destination="PCM-t4-Sha" id="t60-W2-wkV"/>
|
<outlet property="resolutionSelector" destination="PCM-t4-Sha" id="t60-W2-wkV"/>
|
||||||
|
<outlet property="scrollView" destination="iNk-qF-gIr" id="h7U-Xp-ULQ"/>
|
||||||
</connections>
|
</connections>
|
||||||
</viewController>
|
</viewController>
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="RWc-Km-KG5" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
<placeholder placeholderIdentifier="IBFirstResponder" id="RWc-Km-KG5" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user