Skip to content
This repository was archived by the owner on Jun 17, 2023. It is now read-only.

Commit 0f7af31

Browse files
author
Amir Khorsandi
committed
Adjust view sizes for iPad 9.7
1 parent 7301316 commit 0f7af31

File tree

3 files changed

+26
-21
lines changed

3 files changed

+26
-21
lines changed

Samples/PagingLayoutSamples/Modules/LayoutDesigner/Code/LayoutDesignerCodePreviewViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,14 @@ class LayoutDesignerCodePreviewViewController: UIViewController {
6666

6767
private func configureCodeTypeSegmentedControl() {
6868
let segmentedControl = UISegmentedControl()
69-
segmentedControl.insertSegment(withTitle: "Full ViewController", at: 0, animated: false)
69+
segmentedControl.insertSegment(withTitle: "ViewController", at: 0, animated: false)
7070
segmentedControl.insertSegment(withTitle: "Options variable", at: 0, animated: false)
7171
segmentedControl.translatesAutoresizingMaskIntoConstraints = false
7272
view.addSubview(segmentedControl)
7373
codeModeSegmentedControl = segmentedControl
7474
segmentedControl.topAnchor.constraint(equalTo: copyButton.topAnchor).isActive = true
7575
segmentedControl.rightAnchor.constraint(equalTo: copyButton.leftAnchor, constant: -10).isActive = true
76+
segmentedControl.leftAnchor.constraint(greaterThanOrEqualTo: view.leftAnchor, constant: 20).isActive = true
7677
segmentedControl.heightAnchor.constraint(equalTo: copyButton.heightAnchor).isActive = true
7778
segmentedControl.backgroundColor = UIColor.black.withAlphaComponent(0.4)
7879
segmentedControl.selectedSegmentTintColor = UIColor.white.withAlphaComponent(0.4)

Samples/PagingLayoutSamples/Modules/LayoutDesigner/LayoutDesignerViewController.xib

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2626
<subviews>
2727
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="h51-4z-wO0" userLabel="previewContainerView">
28-
<rect key="frame" x="500" y="0.0" width="413.5" height="758"/>
28+
<rect key="frame" x="500" y="0.0" width="384" height="758"/>
2929
<color key="backgroundColor" red="0.1201978996" green="0.27515318989999998" blue="0.87504833940000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3030
<constraints>
31-
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="385" id="IlK-dv-JHb"/>
31+
<constraint firstAttribute="width" relation="greaterThanOrEqual" priority="950" constant="380" id="IlK-dv-JHb"/>
3232
</constraints>
3333
</view>
3434
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nl2-ey-EcQ">
@@ -51,17 +51,17 @@
5151
</constraints>
5252
</imageView>
5353
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" translatesAutoresizingMaskIntoConstraints="NO" id="raf-Ms-swa">
54-
<rect key="frame" x="67" y="17.5" width="157" height="45.5"/>
54+
<rect key="frame" x="67" y="18" width="157" height="44.5"/>
5555
<subviews>
56-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Stack" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tt7-R3-8jZ">
56+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Stack" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tt7-R3-8jZ">
5757
<rect key="frame" x="0.0" y="0.0" width="60" height="27.5"/>
5858
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="23"/>
5959
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
6060
<nil key="highlightedColor"/>
6161
</label>
62-
<label opaque="NO" userInteractionEnabled="NO" alpha="0.33000000000000002" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Transforms" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gxt-MD-XVO">
63-
<rect key="frame" x="0.0" y="27.5" width="82" height="18"/>
64-
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="15"/>
62+
<label opaque="NO" userInteractionEnabled="NO" alpha="0.33000000000000002" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Transforms" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gxt-MD-XVO">
63+
<rect key="frame" x="0.0" y="27.5" width="77" height="17"/>
64+
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
6565
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
6666
<nil key="highlightedColor"/>
6767
</label>
@@ -114,17 +114,17 @@
114114
</constraints>
115115
</imageView>
116116
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" translatesAutoresizingMaskIntoConstraints="NO" id="Ofz-0o-OUc">
117-
<rect key="frame" x="0.0" y="17.5" width="0.0" height="45.5"/>
117+
<rect key="frame" x="0.0" y="18" width="0.0" height="44.5"/>
118118
<subviews>
119-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Scale" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tb6-2m-ksu">
119+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Scale" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tb6-2m-ksu">
120120
<rect key="frame" x="0.0" y="0.0" width="0.0" height="27.5"/>
121121
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="23"/>
122122
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
123123
<nil key="highlightedColor"/>
124124
</label>
125-
<label opaque="NO" userInteractionEnabled="NO" alpha="0.33000001311302185" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Transforms" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0zj-Ck-htM">
126-
<rect key="frame" x="0.0" y="27.5" width="0.0" height="18"/>
127-
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="15"/>
125+
<label opaque="NO" userInteractionEnabled="NO" alpha="0.33000001311302185" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Transforms" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0zj-Ck-htM">
126+
<rect key="frame" x="0.0" y="27.5" width="0.0" height="17"/>
127+
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
128128
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
129129
<nil key="highlightedColor"/>
130130
</label>
@@ -177,21 +177,24 @@
177177
</constraints>
178178
</imageView>
179179
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" translatesAutoresizingMaskIntoConstraints="NO" id="J5u-hn-Wgn">
180-
<rect key="frame" x="0.0" y="17.5" width="0.0" height="45.5"/>
180+
<rect key="frame" x="0.0" y="18" width="0.0" height="44.5"/>
181181
<subviews>
182-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Snapshot" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JB9-E4-KK2">
182+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Snapshot" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="JB9-E4-KK2">
183183
<rect key="frame" x="0.0" y="0.0" width="0.0" height="27.5"/>
184184
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="23"/>
185185
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
186186
<nil key="highlightedColor"/>
187187
</label>
188-
<label opaque="NO" userInteractionEnabled="NO" alpha="0.33000001311302185" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Transforms" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kHF-XD-yed">
189-
<rect key="frame" x="0.0" y="27.5" width="0.0" height="18"/>
190-
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="15"/>
188+
<label opaque="NO" userInteractionEnabled="NO" alpha="0.33000001311302185" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Transforms" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kHF-XD-yed">
189+
<rect key="frame" x="0.0" y="27.5" width="0.0" height="17"/>
190+
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
191191
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
192192
<nil key="highlightedColor"/>
193193
</label>
194194
</subviews>
195+
<constraints>
196+
<constraint firstItem="JB9-E4-KK2" firstAttribute="width" relation="lessThanOrEqual" secondItem="J5u-hn-Wgn" secondAttribute="width" id="4UV-vm-9Q6"/>
197+
</constraints>
195198
</stackView>
196199
</subviews>
197200
</stackView>
@@ -235,7 +238,7 @@
235238
</subviews>
236239
<color key="backgroundColor" name="DesignerBackground"/>
237240
<constraints>
238-
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="320" id="0b8-zO-xfB"/>
241+
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="420" id="0b8-zO-xfB"/>
239242
<constraint firstItem="NyD-R7-l0J" firstAttribute="leading" secondItem="nl2-ey-EcQ" secondAttribute="leading" constant="22" id="EBD-hI-uBV"/>
240243
<constraint firstItem="dmm-bK-wwh" firstAttribute="leading" secondItem="nl2-ey-EcQ" secondAttribute="leading" id="Eko-sH-H04"/>
241244
<constraint firstAttribute="trailing" secondItem="NyD-R7-l0J" secondAttribute="trailing" constant="22" id="FxT-KW-h7C"/>
@@ -246,7 +249,7 @@
246249
</constraints>
247250
</view>
248251
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CdL-lt-E7G" userLabel="codeContainerView">
249-
<rect key="frame" x="913.5" y="0.0" width="563.5" height="758"/>
252+
<rect key="frame" x="884" y="0.0" width="593" height="758"/>
250253
<color key="backgroundColor" red="0.16078431372549018" green="0.16470588235294117" blue="0.18823529411764706" alpha="1" colorSpace="calibratedRGB"/>
251254
<constraints>
252255
<constraint firstAttribute="width" relation="greaterThanOrEqual" priority="755" constant="500" id="A6T-bX-xuz"/>
@@ -262,7 +265,7 @@
262265
<constraint firstItem="CdL-lt-E7G" firstAttribute="leading" secondItem="h51-4z-wO0" secondAttribute="trailing" id="O26-1l-XKk"/>
263266
<constraint firstItem="nl2-ey-EcQ" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="Okj-dI-m1h"/>
264267
<constraint firstItem="NyD-R7-l0J" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" constant="27" id="SMn-96-rTn"/>
265-
<constraint firstItem="h51-4z-wO0" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" multiplier="0.28" id="Wyn-9M-3Y3"/>
268+
<constraint firstItem="h51-4z-wO0" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" multiplier="0.26" priority="999" id="Wyn-9M-3Y3"/>
266269
<constraint firstAttribute="bottom" secondItem="nl2-ey-EcQ" secondAttribute="bottom" id="XQa-RB-BZh"/>
267270
<constraint firstItem="CdL-lt-E7G" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="e7R-N5-XO8"/>
268271
<constraint firstItem="h51-4z-wO0" firstAttribute="leading" secondItem="nl2-ey-EcQ" secondAttribute="trailing" id="iID-XG-rZH"/>

Samples/PagingLayoutSamples/Modules/LayoutDesigner/Options/cell/LayoutDesignerOptionCell.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class LayoutDesignerOptionCell: UITableViewCell, NibBased {
5454
private func setupViews() {
5555
backgroundColor = .clear
5656
label.textColor = UIColor.white.withAlphaComponent(0.7)
57+
label.adjustsFontSizeToFitWidth = true
5758
nilLabel.textColor = UIColor.white.withAlphaComponent(0.7)
5859
[singleSlider, doubleSlider1, doubleSlider2].forEach {
5960
$0?.tintColor = .white

0 commit comments

Comments
 (0)