mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 06:01:13 +00:00
Add scroll view to iPadOS settings
This commit is contained in:
@@ -61,35 +61,33 @@ static const int bitrateTable[] = {
|
|||||||
return i - 1;
|
return i - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This view is rooted at a ScrollView. To make it scrollable,
|
||||||
|
// we'll update content size here.
|
||||||
-(void)viewDidLayoutSubviews {
|
-(void)viewDidLayoutSubviews {
|
||||||
// On iPhone layouts, this view is rooted at a ScrollView. To make it
|
CGFloat highestViewY = 0;
|
||||||
// scrollable, we'll update content size here.
|
|
||||||
if (self.scrollView != nil) {
|
// Enumerate the scroll view's subviews looking for the
|
||||||
CGFloat highestViewY = 0;
|
// highest view Y value to set our scroll view's content
|
||||||
|
// size.
|
||||||
// Enumerate the scroll view's subviews looking for the
|
for (UIView* view in self.scrollView.subviews) {
|
||||||
// highest view Y value to set our scroll view's content
|
// UIScrollViews have 2 default child views
|
||||||
// size.
|
// which represent the horizontal and vertical scrolling
|
||||||
for (UIView* view in self.scrollView.subviews) {
|
// indicators. Ignore any views we don't recognize.
|
||||||
// UIScrollViews have 2 default child views
|
if (![view isKindOfClass:[UILabel class]] &&
|
||||||
// which represent the horizontal and vertical scrolling
|
![view isKindOfClass:[UISegmentedControl class]] &&
|
||||||
// indicators. Ignore any views we don't recognize.
|
![view isKindOfClass:[UISlider class]]) {
|
||||||
if (![view isKindOfClass:[UILabel class]] &&
|
continue;
|
||||||
![view isKindOfClass:[UISegmentedControl class]] &&
|
|
||||||
![view isKindOfClass:[UISlider 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
|
CGFloat currentViewY = view.frame.origin.y + view.frame.size.height;
|
||||||
self.scrollView.contentSize = CGSizeMake(self.scrollView.contentSize.width,
|
if (currentViewY > highestViewY) {
|
||||||
highestViewY + 20);
|
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.
|
||||||
|
|||||||
+2
-1
@@ -58,7 +58,7 @@
|
|||||||
<viewControllerLayoutGuide type="top" id="ef6-uF-5Hh"/>
|
<viewControllerLayoutGuide type="top" id="ef6-uF-5Hh"/>
|
||||||
<viewControllerLayoutGuide type="bottom" id="XvO-F3-j4u"/>
|
<viewControllerLayoutGuide type="bottom" id="XvO-F3-j4u"/>
|
||||||
</layoutGuides>
|
</layoutGuides>
|
||||||
<view key="view" contentMode="scaleToFill" id="WRy-3f-gEP">
|
<view key="view" contentMode="scaleToFill" id="WRy-3f-gEP" customClass="UIScrollView">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="1194" height="834"/>
|
<rect key="frame" x="0.0" y="0.0" width="1194" height="834"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
@@ -285,6 +285,7 @@
|
|||||||
<outlet property="onscreenControlSelector" destination="qSU-wh-tqA" id="j8d-fB-Z2c"/>
|
<outlet property="onscreenControlSelector" destination="qSU-wh-tqA" id="j8d-fB-Z2c"/>
|
||||||
<outlet property="optimizeSettingsSelector" destination="nCO-OT-dV1" id="FB0-Rt-C44"/>
|
<outlet property="optimizeSettingsSelector" destination="nCO-OT-dV1" id="FB0-Rt-C44"/>
|
||||||
<outlet property="resolutionSelector" destination="ckc-Dm-8ex" id="rl6-rx-wd3"/>
|
<outlet property="resolutionSelector" destination="ckc-Dm-8ex" id="rl6-rx-wd3"/>
|
||||||
|
<outlet property="scrollView" destination="WRy-3f-gEP" id="V8B-oF-27B"/>
|
||||||
<outlet property="statsOverlaySelector" destination="NLH-qN-qCo" id="EF8-JF-O3S"/>
|
<outlet property="statsOverlaySelector" destination="NLH-qN-qCo" id="EF8-JF-O3S"/>
|
||||||
<outlet property="touchModeSelector" destination="e4G-id-vjI" id="Cwh-fO-Pou"/>
|
<outlet property="touchModeSelector" destination="e4G-id-vjI" id="Cwh-fO-Pou"/>
|
||||||
</connections>
|
</connections>
|
||||||
|
|||||||
Reference in New Issue
Block a user