Skip to content

Instantly share code, notes, and snippets.

@sakiyamaK
Created May 12, 2021 13:43
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 sakiyamaK/4a1c7d122767973204d76c5b096269c0 to your computer and use it in GitHub Desktop.
Save sakiyamaK/4a1c7d122767973204d76c5b096269c0 to your computer and use it in GitHub Desktop.
脱初心者を目指すAutolayoutの制約の貼り方のサンプル03
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="kla-3h-jRs">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<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>
<!--Sample03-->
<scene sceneID="tJO-aG-kyX">
<objects>
<viewController title="Sample03" id="kla-3h-jRs" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="pLg-NV-P5n">
<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="G3Q-7K-43g">
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5jj-Ts-FyM" userLabel="ContentsView">
<rect key="frame" x="0.0" y="0.0" width="414" height="1636"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zsU-ex-uAU" userLabel="RedView">
<rect key="frame" x="41.5" y="359" width="331" height="100"/>
<color key="backgroundColor" systemColor="systemPinkColor"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="x7n-gT-bSD"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="zsU-ex-uAU" firstAttribute="centerX" secondItem="5jj-Ts-FyM" secondAttribute="centerX" id="V8T-8B-t2k"/>
<constraint firstItem="zsU-ex-uAU" firstAttribute="centerY" secondItem="5jj-Ts-FyM" secondAttribute="centerY" multiplier="0.5" id="noe-hG-V9q"/>
<constraint firstItem="zsU-ex-uAU" firstAttribute="width" secondItem="5jj-Ts-FyM" secondAttribute="width" multiplier="0.8" id="wfu-jL-Ak3"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="5jj-Ts-FyM" firstAttribute="top" secondItem="lXr-Cb-UJD" secondAttribute="top" id="0nT-aW-gMb"/>
<constraint firstItem="5jj-Ts-FyM" firstAttribute="height" secondItem="VDl-oh-5J0" secondAttribute="height" multiplier="2" id="AR8-GD-jdE"/>
<constraint firstItem="5jj-Ts-FyM" firstAttribute="width" secondItem="VDl-oh-5J0" secondAttribute="width" id="Pn8-B7-R5X"/>
<constraint firstItem="5jj-Ts-FyM" firstAttribute="leading" secondItem="lXr-Cb-UJD" secondAttribute="leading" id="XMm-Rw-NyB"/>
<constraint firstItem="5jj-Ts-FyM" firstAttribute="bottom" secondItem="lXr-Cb-UJD" secondAttribute="bottom" id="dFn-Cr-h0o"/>
<constraint firstItem="5jj-Ts-FyM" firstAttribute="trailing" secondItem="lXr-Cb-UJD" secondAttribute="trailing" id="gLd-qi-yJK"/>
</constraints>
<viewLayoutGuide key="contentLayoutGuide" id="lXr-Cb-UJD"/>
<viewLayoutGuide key="frameLayoutGuide" id="VDl-oh-5J0"/>
</scrollView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fbZ-Pc-ap6" userLabel="GreenView">
<rect key="frame" x="167" y="413" width="80" height="80"/>
<color key="backgroundColor" systemColor="systemGreenColor"/>
<constraints>
<constraint firstAttribute="width" secondItem="fbZ-Pc-ap6" secondAttribute="height" id="bIc-8z-cJn"/>
<constraint firstAttribute="width" constant="80" id="kMK-Za-OmG"/>
</constraints>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="zz0-nJ-aJf"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="zsU-ex-uAU" firstAttribute="centerY" secondItem="fbZ-Pc-ap6" secondAttribute="centerY" id="2MQ-q5-5h3"/>
<constraint firstItem="G3Q-7K-43g" firstAttribute="trailing" secondItem="zz0-nJ-aJf" secondAttribute="trailing" id="9nq-si-yUf"/>
<constraint firstItem="G3Q-7K-43g" firstAttribute="top" secondItem="zz0-nJ-aJf" secondAttribute="top" id="YLN-Ah-emT"/>
<constraint firstItem="G3Q-7K-43g" firstAttribute="bottom" secondItem="zz0-nJ-aJf" secondAttribute="bottom" id="eJe-8L-yuH"/>
<constraint firstItem="G3Q-7K-43g" firstAttribute="leading" secondItem="zz0-nJ-aJf" secondAttribute="leading" id="eSZ-rp-Pzs"/>
<constraint firstItem="zsU-ex-uAU" firstAttribute="centerX" secondItem="fbZ-Pc-ap6" secondAttribute="centerX" id="mmx-tR-Pv6"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="sJN-7I-7cY" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1687" y="-627"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemGreenColor">
<color red="0.20392156862745098" green="0.7803921568627451" blue="0.34901960784313724" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemPinkColor">
<color red="1" green="0.17647058823529413" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment