Skip to content

Instantly share code, notes, and snippets.

@DaisukeNagata
Created November 1, 2020 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DaisukeNagata/b7dc924f2ec9ab0105f538083b6350d6 to your computer and use it in GitHub Desktop.
Save DaisukeNagata/b7dc924f2ec9ab0105f538083b6350d6 to your computer and use it in GitHub Desktop.
Simple ScrollView
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_0" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17126"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="SimpleScrollView" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cQt-mp-6Ye">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="3Oa-jV-WjS">
<rect key="frame" x="0.0" y="0.0" width="414" height="1200"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mEp-8o-AWz">
<rect key="frame" x="0.0" y="0.0" width="414" height="400"/>
<color key="backgroundColor" systemColor="systemRedColor"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Z0T-GX-16w">
<rect key="frame" x="0.0" y="400" width="414" height="400"/>
<color key="backgroundColor" systemColor="systemBlueColor"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xBa-ML-rqc">
<rect key="frame" x="0.0" y="800" width="414" height="400"/>
<color key="backgroundColor" systemColor="systemYellowColor"/>
</view>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="1200" id="Tbz-zh-gmh"/>
<constraint firstItem="Z0T-GX-16w" firstAttribute="height" secondItem="mEp-8o-AWz" secondAttribute="height" id="UPb-gd-5lq"/>
<constraint firstItem="xBa-ML-rqc" firstAttribute="height" secondItem="mEp-8o-AWz" secondAttribute="height" id="wNp-oK-0zq"/>
</constraints>
</stackView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="3Oa-jV-WjS" firstAttribute="leading" secondItem="Xot-HS-0T4" secondAttribute="leading" id="0g2-5a-4iu"/>
<constraint firstAttribute="bottom" secondItem="3Oa-jV-WjS" secondAttribute="bottom" id="A37-JG-eLb"/>
<constraint firstItem="3Oa-jV-WjS" firstAttribute="trailing" secondItem="Xot-HS-0T4" secondAttribute="trailing" id="QxI-PF-RbE"/>
<constraint firstAttribute="trailing" secondItem="3Oa-jV-WjS" secondAttribute="trailing" id="iit-39-tNl"/>
<constraint firstItem="3Oa-jV-WjS" firstAttribute="top" secondItem="cQt-mp-6Ye" secondAttribute="top" id="kF2-4c-8gX"/>
<constraint firstItem="3Oa-jV-WjS" firstAttribute="width" secondItem="cQt-mp-6Ye" secondAttribute="width" id="w2F-2y-h56"/>
</constraints>
<viewLayoutGuide key="contentLayoutGuide" id="pwh-E1-8Jc"/>
<viewLayoutGuide key="frameLayoutGuide" id="Xot-HS-0T4"/>
</scrollView>
</subviews>
<viewLayoutGuide key="safeArea" id="2R9-PQ-6Ca"/>
<constraints>
<constraint firstItem="cQt-mp-6Ye" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="Kdb-5w-VAe"/>
<constraint firstItem="cQt-mp-6Ye" firstAttribute="trailing" secondItem="2R9-PQ-6Ca" secondAttribute="trailing" id="S4v-Z7-qQk"/>
<constraint firstAttribute="bottom" secondItem="cQt-mp-6Ye" secondAttribute="bottom" id="Uue-8I-v93"/>
<constraint firstItem="cQt-mp-6Ye" firstAttribute="leading" secondItem="2R9-PQ-6Ca" secondAttribute="leading" id="nsQ-5N-rQp"/>
</constraints>
</view>
<size key="freeformSize" width="414" height="896"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="136.92307692307691" y="118.00947867298578"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemBlueColor">
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemRedColor">
<color red="1" green="0.23137254901960785" blue="0.18823529411764706" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemYellowColor">
<color red="1" green="0.80000000000000004" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
@DaisukeNagata
Copy link
Author

StackView
スクリーンショット 2020-11-01 16 08 23

@DaisukeNagata
Copy link
Author

ScrollView
スクリーンショット 2020-11-01 16 07 55

@DaisukeNagata
Copy link
Author

Main.storyboard ダブルクリック、Open As-> Source Code で、ソースを貼ると、ScrollViewを確認できます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment