StackView Height Swift
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
Here is what I am trying to do:
The screenshot is taken from an earlier version of iOS
device.
I am using UIStackView
I am really confused how to automatically show the first line. This is my UIStackView
Properties in Main.StoryBoard.
Stack View Constraints:
How to Show only two line on UIStackView
and as well as how to change the height of the lines in the show in the first image.
Thanks in Advance.
ios iphone swift uistackview
add a comment |
Here is what I am trying to do:
The screenshot is taken from an earlier version of iOS
device.
I am using UIStackView
I am really confused how to automatically show the first line. This is my UIStackView
Properties in Main.StoryBoard.
Stack View Constraints:
How to Show only two line on UIStackView
and as well as how to change the height of the lines in the show in the first image.
Thanks in Advance.
ios iphone swift uistackview
an easy solution willl be to add simple UIView with 1px width and gray background where you need it.
– m1sh0
Nov 15 '18 at 8:35
Place the vertical line UILabels along with other text UILabels with some vertical space in top and bottom.
– Sateesh
Nov 15 '18 at 8:37
your stackView should contain only 3 labels with stackView.distribution = .fillEqually. Then, with autolayout, you clip 2 vertical insets views of 1 px width to the rightAnchor of the 2 first labels from the left. With autolayout, you can adjust the padding of the vertical inset views so that their height is less than your labels' heights
– Laurent Maquet
Nov 15 '18 at 8:54
add a comment |
Here is what I am trying to do:
The screenshot is taken from an earlier version of iOS
device.
I am using UIStackView
I am really confused how to automatically show the first line. This is my UIStackView
Properties in Main.StoryBoard.
Stack View Constraints:
How to Show only two line on UIStackView
and as well as how to change the height of the lines in the show in the first image.
Thanks in Advance.
ios iphone swift uistackview
Here is what I am trying to do:
The screenshot is taken from an earlier version of iOS
device.
I am using UIStackView
I am really confused how to automatically show the first line. This is my UIStackView
Properties in Main.StoryBoard.
Stack View Constraints:
How to Show only two line on UIStackView
and as well as how to change the height of the lines in the show in the first image.
Thanks in Advance.
ios iphone swift uistackview
ios iphone swift uistackview
edited Nov 15 '18 at 10:01
Sateesh
2,18711020
2,18711020
asked Nov 15 '18 at 8:19
user9822311
an easy solution willl be to add simple UIView with 1px width and gray background where you need it.
– m1sh0
Nov 15 '18 at 8:35
Place the vertical line UILabels along with other text UILabels with some vertical space in top and bottom.
– Sateesh
Nov 15 '18 at 8:37
your stackView should contain only 3 labels with stackView.distribution = .fillEqually. Then, with autolayout, you clip 2 vertical insets views of 1 px width to the rightAnchor of the 2 first labels from the left. With autolayout, you can adjust the padding of the vertical inset views so that their height is less than your labels' heights
– Laurent Maquet
Nov 15 '18 at 8:54
add a comment |
an easy solution willl be to add simple UIView with 1px width and gray background where you need it.
– m1sh0
Nov 15 '18 at 8:35
Place the vertical line UILabels along with other text UILabels with some vertical space in top and bottom.
– Sateesh
Nov 15 '18 at 8:37
your stackView should contain only 3 labels with stackView.distribution = .fillEqually. Then, with autolayout, you clip 2 vertical insets views of 1 px width to the rightAnchor of the 2 first labels from the left. With autolayout, you can adjust the padding of the vertical inset views so that their height is less than your labels' heights
– Laurent Maquet
Nov 15 '18 at 8:54
an easy solution willl be to add simple UIView with 1px width and gray background where you need it.
– m1sh0
Nov 15 '18 at 8:35
an easy solution willl be to add simple UIView with 1px width and gray background where you need it.
– m1sh0
Nov 15 '18 at 8:35
Place the vertical line UILabels along with other text UILabels with some vertical space in top and bottom.
– Sateesh
Nov 15 '18 at 8:37
Place the vertical line UILabels along with other text UILabels with some vertical space in top and bottom.
– Sateesh
Nov 15 '18 at 8:37
your stackView should contain only 3 labels with stackView.distribution = .fillEqually. Then, with autolayout, you clip 2 vertical insets views of 1 px width to the rightAnchor of the 2 first labels from the left. With autolayout, you can adjust the padding of the vertical inset views so that their height is less than your labels' heights
– Laurent Maquet
Nov 15 '18 at 8:54
your stackView should contain only 3 labels with stackView.distribution = .fillEqually. Then, with autolayout, you clip 2 vertical insets views of 1 px width to the rightAnchor of the 2 first labels from the left. With autolayout, you can adjust the padding of the vertical inset views so that their height is less than your labels' heights
– Laurent Maquet
Nov 15 '18 at 8:54
add a comment |
1 Answer
1
active
oldest
votes
Copy the source code to Main.storyboard
.
Storyboard source code:
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController storyboardIdentifier="ViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="BYZ-38-t0r" customClass="ViewController" customModule="WebViewDemo" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalCentering" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="01T-u6-sKf">
<rect key="frame" x="16" y="20" width="344" height="80"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="tE3-oQ-8LA">
<rect key="frame" x="0.0" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="15K" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p33-9y-oh7">
<rect key="frame" x="41.5" y="0.0" width="31" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Followers" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yuq-uy-Eao">
<rect key="frame" x="21" y="44" width="72.5" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VUJ-3f-pVe">
<rect key="frame" x="114" y="16" width="1" height="48"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="9Km-KS-Zha"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="utx-f8-Egz">
<rect key="frame" x="115" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="5K" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Sx-mY-4VA">
<rect key="frame" x="45.5" y="0.0" width="23" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Following" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="50u-5R-t7d">
<rect key="frame" x="21" y="44" width="72.5" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o9A-oG-RGD">
<rect key="frame" x="229" y="16" width="1" height="48"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="eZ8-kX-Faf"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="hxS-Lp-BjF">
<rect key="frame" x="230" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="525" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wSr-MP-om2">
<rect key="frame" x="41" y="0.0" width="32.5" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Burns" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xJ4-kn-IRm">
<rect key="frame" x="34.5" y="44" width="45" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<constraints>
<constraint firstItem="VUJ-3f-pVe" firstAttribute="leading" secondItem="tE3-oQ-8LA" secondAttribute="trailing" id="0dJ-QC-0DN"/>
<constraint firstItem="o9A-oG-RGD" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" constant="16" id="0eJ-ZF-PoX"/>
<constraint firstItem="tE3-oQ-8LA" firstAttribute="leading" secondItem="01T-u6-sKf" secondAttribute="leading" id="4XF-Ad-BxL"/>
<constraint firstAttribute="bottom" secondItem="VUJ-3f-pVe" secondAttribute="bottom" constant="16" id="Cb6-ku-gaI"/>
<constraint firstAttribute="height" constant="80" id="GeZ-22-Qc4"/>
<constraint firstItem="o9A-oG-RGD" firstAttribute="leading" secondItem="utx-f8-Egz" secondAttribute="trailing" id="OqV-dm-Emb"/>
<constraint firstItem="utx-f8-Egz" firstAttribute="leading" secondItem="VUJ-3f-pVe" secondAttribute="trailing" id="Tpj-O7-XI4"/>
<constraint firstItem="tE3-oQ-8LA" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="VA4-Ir-THO"/>
<constraint firstAttribute="bottom" secondItem="tE3-oQ-8LA" secondAttribute="bottom" id="Wi3-mb-45i"/>
<constraint firstAttribute="trailing" secondItem="hxS-Lp-BjF" secondAttribute="trailing" id="aMM-CS-yXY"/>
<constraint firstItem="utx-f8-Egz" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="bXD-RW-EuA"/>
<constraint firstAttribute="bottom" secondItem="utx-f8-Egz" secondAttribute="bottom" id="bvK-yl-vkB"/>
<constraint firstAttribute="bottom" secondItem="hxS-Lp-BjF" secondAttribute="bottom" id="iMQ-sM-sIg"/>
<constraint firstItem="hxS-Lp-BjF" firstAttribute="leading" secondItem="o9A-oG-RGD" secondAttribute="trailing" id="pY7-nS-6KF"/>
<constraint firstItem="hxS-Lp-BjF" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="rgj-uE-EWc"/>
<constraint firstItem="VUJ-3f-pVe" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" constant="16" id="vLJ-85-Xhj"/>
<constraint firstAttribute="bottom" secondItem="o9A-oG-RGD" secondAttribute="bottom" constant="16" id="wbg-fS-F8A"/>
</constraints>
</stackView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="01T-u6-sKf" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="adL-or-9pL"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="01T-u6-sKf" secondAttribute="trailing" constant="15" id="bCu-2x-su3"/>
<constraint firstItem="01T-u6-sKf" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="16" id="zpl-R5-rv3"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<navigationItem key="navigationItem" id="9BY-rh-0CG">
<leftBarButtonItems>
<barButtonItem systemItem="done" id="7Ff-GP-OPr"/>
<barButtonItem systemItem="done" id="LFG-6n-5oQ"/>
</leftBarButtonItems>
<rightBarButtonItems>
<barButtonItem systemItem="done" id="SQo-Ld-g7A"/>
<barButtonItem systemItem="done" id="QZU-TY-dGK"/>
<barButtonItem systemItem="done" id="9Xe-Uw-Gzb"/>
</rightBarButtonItems>
</navigationItem>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="927.20000000000005" y="44.527736131934034"/>
</scene>
</scenes>
</document>
Edit:
https://bitbucket.org/Sateesh_Y/stackviewdemo/src/master/
All good but height of label Constant didn't worked they show as well as same in first image.
– user9822311
Nov 15 '18 at 10:40
Height of the label is dynamic. Its always depends on the height of UIStackView. I gave 16 top space, 16 bottom space for UILabels from UIStackView, please have a look once.
– Sateesh
Nov 15 '18 at 10:47
I have updated the answer. Check the project in Edit.
– Sateesh
Nov 15 '18 at 13:28
1
@Sateesh - providing source is fine, but your answer should also explain what you're doing to solve the question.
– DonMag
Nov 15 '18 at 19:33
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53315057%2fstackview-height-swift%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Copy the source code to Main.storyboard
.
Storyboard source code:
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController storyboardIdentifier="ViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="BYZ-38-t0r" customClass="ViewController" customModule="WebViewDemo" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalCentering" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="01T-u6-sKf">
<rect key="frame" x="16" y="20" width="344" height="80"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="tE3-oQ-8LA">
<rect key="frame" x="0.0" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="15K" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p33-9y-oh7">
<rect key="frame" x="41.5" y="0.0" width="31" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Followers" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yuq-uy-Eao">
<rect key="frame" x="21" y="44" width="72.5" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VUJ-3f-pVe">
<rect key="frame" x="114" y="16" width="1" height="48"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="9Km-KS-Zha"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="utx-f8-Egz">
<rect key="frame" x="115" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="5K" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Sx-mY-4VA">
<rect key="frame" x="45.5" y="0.0" width="23" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Following" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="50u-5R-t7d">
<rect key="frame" x="21" y="44" width="72.5" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o9A-oG-RGD">
<rect key="frame" x="229" y="16" width="1" height="48"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="eZ8-kX-Faf"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="hxS-Lp-BjF">
<rect key="frame" x="230" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="525" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wSr-MP-om2">
<rect key="frame" x="41" y="0.0" width="32.5" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Burns" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xJ4-kn-IRm">
<rect key="frame" x="34.5" y="44" width="45" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<constraints>
<constraint firstItem="VUJ-3f-pVe" firstAttribute="leading" secondItem="tE3-oQ-8LA" secondAttribute="trailing" id="0dJ-QC-0DN"/>
<constraint firstItem="o9A-oG-RGD" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" constant="16" id="0eJ-ZF-PoX"/>
<constraint firstItem="tE3-oQ-8LA" firstAttribute="leading" secondItem="01T-u6-sKf" secondAttribute="leading" id="4XF-Ad-BxL"/>
<constraint firstAttribute="bottom" secondItem="VUJ-3f-pVe" secondAttribute="bottom" constant="16" id="Cb6-ku-gaI"/>
<constraint firstAttribute="height" constant="80" id="GeZ-22-Qc4"/>
<constraint firstItem="o9A-oG-RGD" firstAttribute="leading" secondItem="utx-f8-Egz" secondAttribute="trailing" id="OqV-dm-Emb"/>
<constraint firstItem="utx-f8-Egz" firstAttribute="leading" secondItem="VUJ-3f-pVe" secondAttribute="trailing" id="Tpj-O7-XI4"/>
<constraint firstItem="tE3-oQ-8LA" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="VA4-Ir-THO"/>
<constraint firstAttribute="bottom" secondItem="tE3-oQ-8LA" secondAttribute="bottom" id="Wi3-mb-45i"/>
<constraint firstAttribute="trailing" secondItem="hxS-Lp-BjF" secondAttribute="trailing" id="aMM-CS-yXY"/>
<constraint firstItem="utx-f8-Egz" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="bXD-RW-EuA"/>
<constraint firstAttribute="bottom" secondItem="utx-f8-Egz" secondAttribute="bottom" id="bvK-yl-vkB"/>
<constraint firstAttribute="bottom" secondItem="hxS-Lp-BjF" secondAttribute="bottom" id="iMQ-sM-sIg"/>
<constraint firstItem="hxS-Lp-BjF" firstAttribute="leading" secondItem="o9A-oG-RGD" secondAttribute="trailing" id="pY7-nS-6KF"/>
<constraint firstItem="hxS-Lp-BjF" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="rgj-uE-EWc"/>
<constraint firstItem="VUJ-3f-pVe" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" constant="16" id="vLJ-85-Xhj"/>
<constraint firstAttribute="bottom" secondItem="o9A-oG-RGD" secondAttribute="bottom" constant="16" id="wbg-fS-F8A"/>
</constraints>
</stackView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="01T-u6-sKf" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="adL-or-9pL"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="01T-u6-sKf" secondAttribute="trailing" constant="15" id="bCu-2x-su3"/>
<constraint firstItem="01T-u6-sKf" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="16" id="zpl-R5-rv3"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<navigationItem key="navigationItem" id="9BY-rh-0CG">
<leftBarButtonItems>
<barButtonItem systemItem="done" id="7Ff-GP-OPr"/>
<barButtonItem systemItem="done" id="LFG-6n-5oQ"/>
</leftBarButtonItems>
<rightBarButtonItems>
<barButtonItem systemItem="done" id="SQo-Ld-g7A"/>
<barButtonItem systemItem="done" id="QZU-TY-dGK"/>
<barButtonItem systemItem="done" id="9Xe-Uw-Gzb"/>
</rightBarButtonItems>
</navigationItem>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="927.20000000000005" y="44.527736131934034"/>
</scene>
</scenes>
</document>
Edit:
https://bitbucket.org/Sateesh_Y/stackviewdemo/src/master/
All good but height of label Constant didn't worked they show as well as same in first image.
– user9822311
Nov 15 '18 at 10:40
Height of the label is dynamic. Its always depends on the height of UIStackView. I gave 16 top space, 16 bottom space for UILabels from UIStackView, please have a look once.
– Sateesh
Nov 15 '18 at 10:47
I have updated the answer. Check the project in Edit.
– Sateesh
Nov 15 '18 at 13:28
1
@Sateesh - providing source is fine, but your answer should also explain what you're doing to solve the question.
– DonMag
Nov 15 '18 at 19:33
add a comment |
Copy the source code to Main.storyboard
.
Storyboard source code:
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController storyboardIdentifier="ViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="BYZ-38-t0r" customClass="ViewController" customModule="WebViewDemo" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalCentering" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="01T-u6-sKf">
<rect key="frame" x="16" y="20" width="344" height="80"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="tE3-oQ-8LA">
<rect key="frame" x="0.0" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="15K" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p33-9y-oh7">
<rect key="frame" x="41.5" y="0.0" width="31" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Followers" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yuq-uy-Eao">
<rect key="frame" x="21" y="44" width="72.5" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VUJ-3f-pVe">
<rect key="frame" x="114" y="16" width="1" height="48"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="9Km-KS-Zha"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="utx-f8-Egz">
<rect key="frame" x="115" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="5K" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Sx-mY-4VA">
<rect key="frame" x="45.5" y="0.0" width="23" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Following" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="50u-5R-t7d">
<rect key="frame" x="21" y="44" width="72.5" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o9A-oG-RGD">
<rect key="frame" x="229" y="16" width="1" height="48"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="eZ8-kX-Faf"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="hxS-Lp-BjF">
<rect key="frame" x="230" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="525" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wSr-MP-om2">
<rect key="frame" x="41" y="0.0" width="32.5" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Burns" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xJ4-kn-IRm">
<rect key="frame" x="34.5" y="44" width="45" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<constraints>
<constraint firstItem="VUJ-3f-pVe" firstAttribute="leading" secondItem="tE3-oQ-8LA" secondAttribute="trailing" id="0dJ-QC-0DN"/>
<constraint firstItem="o9A-oG-RGD" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" constant="16" id="0eJ-ZF-PoX"/>
<constraint firstItem="tE3-oQ-8LA" firstAttribute="leading" secondItem="01T-u6-sKf" secondAttribute="leading" id="4XF-Ad-BxL"/>
<constraint firstAttribute="bottom" secondItem="VUJ-3f-pVe" secondAttribute="bottom" constant="16" id="Cb6-ku-gaI"/>
<constraint firstAttribute="height" constant="80" id="GeZ-22-Qc4"/>
<constraint firstItem="o9A-oG-RGD" firstAttribute="leading" secondItem="utx-f8-Egz" secondAttribute="trailing" id="OqV-dm-Emb"/>
<constraint firstItem="utx-f8-Egz" firstAttribute="leading" secondItem="VUJ-3f-pVe" secondAttribute="trailing" id="Tpj-O7-XI4"/>
<constraint firstItem="tE3-oQ-8LA" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="VA4-Ir-THO"/>
<constraint firstAttribute="bottom" secondItem="tE3-oQ-8LA" secondAttribute="bottom" id="Wi3-mb-45i"/>
<constraint firstAttribute="trailing" secondItem="hxS-Lp-BjF" secondAttribute="trailing" id="aMM-CS-yXY"/>
<constraint firstItem="utx-f8-Egz" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="bXD-RW-EuA"/>
<constraint firstAttribute="bottom" secondItem="utx-f8-Egz" secondAttribute="bottom" id="bvK-yl-vkB"/>
<constraint firstAttribute="bottom" secondItem="hxS-Lp-BjF" secondAttribute="bottom" id="iMQ-sM-sIg"/>
<constraint firstItem="hxS-Lp-BjF" firstAttribute="leading" secondItem="o9A-oG-RGD" secondAttribute="trailing" id="pY7-nS-6KF"/>
<constraint firstItem="hxS-Lp-BjF" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="rgj-uE-EWc"/>
<constraint firstItem="VUJ-3f-pVe" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" constant="16" id="vLJ-85-Xhj"/>
<constraint firstAttribute="bottom" secondItem="o9A-oG-RGD" secondAttribute="bottom" constant="16" id="wbg-fS-F8A"/>
</constraints>
</stackView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="01T-u6-sKf" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="adL-or-9pL"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="01T-u6-sKf" secondAttribute="trailing" constant="15" id="bCu-2x-su3"/>
<constraint firstItem="01T-u6-sKf" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="16" id="zpl-R5-rv3"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<navigationItem key="navigationItem" id="9BY-rh-0CG">
<leftBarButtonItems>
<barButtonItem systemItem="done" id="7Ff-GP-OPr"/>
<barButtonItem systemItem="done" id="LFG-6n-5oQ"/>
</leftBarButtonItems>
<rightBarButtonItems>
<barButtonItem systemItem="done" id="SQo-Ld-g7A"/>
<barButtonItem systemItem="done" id="QZU-TY-dGK"/>
<barButtonItem systemItem="done" id="9Xe-Uw-Gzb"/>
</rightBarButtonItems>
</navigationItem>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="927.20000000000005" y="44.527736131934034"/>
</scene>
</scenes>
</document>
Edit:
https://bitbucket.org/Sateesh_Y/stackviewdemo/src/master/
All good but height of label Constant didn't worked they show as well as same in first image.
– user9822311
Nov 15 '18 at 10:40
Height of the label is dynamic. Its always depends on the height of UIStackView. I gave 16 top space, 16 bottom space for UILabels from UIStackView, please have a look once.
– Sateesh
Nov 15 '18 at 10:47
I have updated the answer. Check the project in Edit.
– Sateesh
Nov 15 '18 at 13:28
1
@Sateesh - providing source is fine, but your answer should also explain what you're doing to solve the question.
– DonMag
Nov 15 '18 at 19:33
add a comment |
Copy the source code to Main.storyboard
.
Storyboard source code:
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController storyboardIdentifier="ViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="BYZ-38-t0r" customClass="ViewController" customModule="WebViewDemo" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalCentering" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="01T-u6-sKf">
<rect key="frame" x="16" y="20" width="344" height="80"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="tE3-oQ-8LA">
<rect key="frame" x="0.0" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="15K" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p33-9y-oh7">
<rect key="frame" x="41.5" y="0.0" width="31" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Followers" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yuq-uy-Eao">
<rect key="frame" x="21" y="44" width="72.5" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VUJ-3f-pVe">
<rect key="frame" x="114" y="16" width="1" height="48"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="9Km-KS-Zha"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="utx-f8-Egz">
<rect key="frame" x="115" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="5K" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Sx-mY-4VA">
<rect key="frame" x="45.5" y="0.0" width="23" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Following" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="50u-5R-t7d">
<rect key="frame" x="21" y="44" width="72.5" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o9A-oG-RGD">
<rect key="frame" x="229" y="16" width="1" height="48"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="eZ8-kX-Faf"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="hxS-Lp-BjF">
<rect key="frame" x="230" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="525" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wSr-MP-om2">
<rect key="frame" x="41" y="0.0" width="32.5" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Burns" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xJ4-kn-IRm">
<rect key="frame" x="34.5" y="44" width="45" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<constraints>
<constraint firstItem="VUJ-3f-pVe" firstAttribute="leading" secondItem="tE3-oQ-8LA" secondAttribute="trailing" id="0dJ-QC-0DN"/>
<constraint firstItem="o9A-oG-RGD" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" constant="16" id="0eJ-ZF-PoX"/>
<constraint firstItem="tE3-oQ-8LA" firstAttribute="leading" secondItem="01T-u6-sKf" secondAttribute="leading" id="4XF-Ad-BxL"/>
<constraint firstAttribute="bottom" secondItem="VUJ-3f-pVe" secondAttribute="bottom" constant="16" id="Cb6-ku-gaI"/>
<constraint firstAttribute="height" constant="80" id="GeZ-22-Qc4"/>
<constraint firstItem="o9A-oG-RGD" firstAttribute="leading" secondItem="utx-f8-Egz" secondAttribute="trailing" id="OqV-dm-Emb"/>
<constraint firstItem="utx-f8-Egz" firstAttribute="leading" secondItem="VUJ-3f-pVe" secondAttribute="trailing" id="Tpj-O7-XI4"/>
<constraint firstItem="tE3-oQ-8LA" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="VA4-Ir-THO"/>
<constraint firstAttribute="bottom" secondItem="tE3-oQ-8LA" secondAttribute="bottom" id="Wi3-mb-45i"/>
<constraint firstAttribute="trailing" secondItem="hxS-Lp-BjF" secondAttribute="trailing" id="aMM-CS-yXY"/>
<constraint firstItem="utx-f8-Egz" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="bXD-RW-EuA"/>
<constraint firstAttribute="bottom" secondItem="utx-f8-Egz" secondAttribute="bottom" id="bvK-yl-vkB"/>
<constraint firstAttribute="bottom" secondItem="hxS-Lp-BjF" secondAttribute="bottom" id="iMQ-sM-sIg"/>
<constraint firstItem="hxS-Lp-BjF" firstAttribute="leading" secondItem="o9A-oG-RGD" secondAttribute="trailing" id="pY7-nS-6KF"/>
<constraint firstItem="hxS-Lp-BjF" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="rgj-uE-EWc"/>
<constraint firstItem="VUJ-3f-pVe" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" constant="16" id="vLJ-85-Xhj"/>
<constraint firstAttribute="bottom" secondItem="o9A-oG-RGD" secondAttribute="bottom" constant="16" id="wbg-fS-F8A"/>
</constraints>
</stackView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="01T-u6-sKf" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="adL-or-9pL"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="01T-u6-sKf" secondAttribute="trailing" constant="15" id="bCu-2x-su3"/>
<constraint firstItem="01T-u6-sKf" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="16" id="zpl-R5-rv3"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<navigationItem key="navigationItem" id="9BY-rh-0CG">
<leftBarButtonItems>
<barButtonItem systemItem="done" id="7Ff-GP-OPr"/>
<barButtonItem systemItem="done" id="LFG-6n-5oQ"/>
</leftBarButtonItems>
<rightBarButtonItems>
<barButtonItem systemItem="done" id="SQo-Ld-g7A"/>
<barButtonItem systemItem="done" id="QZU-TY-dGK"/>
<barButtonItem systemItem="done" id="9Xe-Uw-Gzb"/>
</rightBarButtonItems>
</navigationItem>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="927.20000000000005" y="44.527736131934034"/>
</scene>
</scenes>
</document>
Edit:
https://bitbucket.org/Sateesh_Y/stackviewdemo/src/master/
Copy the source code to Main.storyboard
.
Storyboard source code:
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController storyboardIdentifier="ViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="BYZ-38-t0r" customClass="ViewController" customModule="WebViewDemo" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalCentering" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="01T-u6-sKf">
<rect key="frame" x="16" y="20" width="344" height="80"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="tE3-oQ-8LA">
<rect key="frame" x="0.0" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="15K" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p33-9y-oh7">
<rect key="frame" x="41.5" y="0.0" width="31" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Followers" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yuq-uy-Eao">
<rect key="frame" x="21" y="44" width="72.5" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VUJ-3f-pVe">
<rect key="frame" x="114" y="16" width="1" height="48"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="9Km-KS-Zha"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="utx-f8-Egz">
<rect key="frame" x="115" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="5K" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Sx-mY-4VA">
<rect key="frame" x="45.5" y="0.0" width="23" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Following" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="50u-5R-t7d">
<rect key="frame" x="21" y="44" width="72.5" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o9A-oG-RGD">
<rect key="frame" x="229" y="16" width="1" height="48"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="eZ8-kX-Faf"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="hxS-Lp-BjF">
<rect key="frame" x="230" y="0.0" width="114" height="80"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="525" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wSr-MP-om2">
<rect key="frame" x="41" y="0.0" width="32.5" height="36"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Burns" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xJ4-kn-IRm">
<rect key="frame" x="34.5" y="44" width="45" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<constraints>
<constraint firstItem="VUJ-3f-pVe" firstAttribute="leading" secondItem="tE3-oQ-8LA" secondAttribute="trailing" id="0dJ-QC-0DN"/>
<constraint firstItem="o9A-oG-RGD" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" constant="16" id="0eJ-ZF-PoX"/>
<constraint firstItem="tE3-oQ-8LA" firstAttribute="leading" secondItem="01T-u6-sKf" secondAttribute="leading" id="4XF-Ad-BxL"/>
<constraint firstAttribute="bottom" secondItem="VUJ-3f-pVe" secondAttribute="bottom" constant="16" id="Cb6-ku-gaI"/>
<constraint firstAttribute="height" constant="80" id="GeZ-22-Qc4"/>
<constraint firstItem="o9A-oG-RGD" firstAttribute="leading" secondItem="utx-f8-Egz" secondAttribute="trailing" id="OqV-dm-Emb"/>
<constraint firstItem="utx-f8-Egz" firstAttribute="leading" secondItem="VUJ-3f-pVe" secondAttribute="trailing" id="Tpj-O7-XI4"/>
<constraint firstItem="tE3-oQ-8LA" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="VA4-Ir-THO"/>
<constraint firstAttribute="bottom" secondItem="tE3-oQ-8LA" secondAttribute="bottom" id="Wi3-mb-45i"/>
<constraint firstAttribute="trailing" secondItem="hxS-Lp-BjF" secondAttribute="trailing" id="aMM-CS-yXY"/>
<constraint firstItem="utx-f8-Egz" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="bXD-RW-EuA"/>
<constraint firstAttribute="bottom" secondItem="utx-f8-Egz" secondAttribute="bottom" id="bvK-yl-vkB"/>
<constraint firstAttribute="bottom" secondItem="hxS-Lp-BjF" secondAttribute="bottom" id="iMQ-sM-sIg"/>
<constraint firstItem="hxS-Lp-BjF" firstAttribute="leading" secondItem="o9A-oG-RGD" secondAttribute="trailing" id="pY7-nS-6KF"/>
<constraint firstItem="hxS-Lp-BjF" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" id="rgj-uE-EWc"/>
<constraint firstItem="VUJ-3f-pVe" firstAttribute="top" secondItem="01T-u6-sKf" secondAttribute="top" constant="16" id="vLJ-85-Xhj"/>
<constraint firstAttribute="bottom" secondItem="o9A-oG-RGD" secondAttribute="bottom" constant="16" id="wbg-fS-F8A"/>
</constraints>
</stackView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="01T-u6-sKf" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="adL-or-9pL"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="01T-u6-sKf" secondAttribute="trailing" constant="15" id="bCu-2x-su3"/>
<constraint firstItem="01T-u6-sKf" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="16" id="zpl-R5-rv3"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<navigationItem key="navigationItem" id="9BY-rh-0CG">
<leftBarButtonItems>
<barButtonItem systemItem="done" id="7Ff-GP-OPr"/>
<barButtonItem systemItem="done" id="LFG-6n-5oQ"/>
</leftBarButtonItems>
<rightBarButtonItems>
<barButtonItem systemItem="done" id="SQo-Ld-g7A"/>
<barButtonItem systemItem="done" id="QZU-TY-dGK"/>
<barButtonItem systemItem="done" id="9Xe-Uw-Gzb"/>
</rightBarButtonItems>
</navigationItem>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="927.20000000000005" y="44.527736131934034"/>
</scene>
</scenes>
</document>
Edit:
https://bitbucket.org/Sateesh_Y/stackviewdemo/src/master/
edited Nov 15 '18 at 13:27
answered Nov 15 '18 at 9:30
SateeshSateesh
2,18711020
2,18711020
All good but height of label Constant didn't worked they show as well as same in first image.
– user9822311
Nov 15 '18 at 10:40
Height of the label is dynamic. Its always depends on the height of UIStackView. I gave 16 top space, 16 bottom space for UILabels from UIStackView, please have a look once.
– Sateesh
Nov 15 '18 at 10:47
I have updated the answer. Check the project in Edit.
– Sateesh
Nov 15 '18 at 13:28
1
@Sateesh - providing source is fine, but your answer should also explain what you're doing to solve the question.
– DonMag
Nov 15 '18 at 19:33
add a comment |
All good but height of label Constant didn't worked they show as well as same in first image.
– user9822311
Nov 15 '18 at 10:40
Height of the label is dynamic. Its always depends on the height of UIStackView. I gave 16 top space, 16 bottom space for UILabels from UIStackView, please have a look once.
– Sateesh
Nov 15 '18 at 10:47
I have updated the answer. Check the project in Edit.
– Sateesh
Nov 15 '18 at 13:28
1
@Sateesh - providing source is fine, but your answer should also explain what you're doing to solve the question.
– DonMag
Nov 15 '18 at 19:33
All good but height of label Constant didn't worked they show as well as same in first image.
– user9822311
Nov 15 '18 at 10:40
All good but height of label Constant didn't worked they show as well as same in first image.
– user9822311
Nov 15 '18 at 10:40
Height of the label is dynamic. Its always depends on the height of UIStackView. I gave 16 top space, 16 bottom space for UILabels from UIStackView, please have a look once.
– Sateesh
Nov 15 '18 at 10:47
Height of the label is dynamic. Its always depends on the height of UIStackView. I gave 16 top space, 16 bottom space for UILabels from UIStackView, please have a look once.
– Sateesh
Nov 15 '18 at 10:47
I have updated the answer. Check the project in Edit.
– Sateesh
Nov 15 '18 at 13:28
I have updated the answer. Check the project in Edit.
– Sateesh
Nov 15 '18 at 13:28
1
1
@Sateesh - providing source is fine, but your answer should also explain what you're doing to solve the question.
– DonMag
Nov 15 '18 at 19:33
@Sateesh - providing source is fine, but your answer should also explain what you're doing to solve the question.
– DonMag
Nov 15 '18 at 19:33
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53315057%2fstackview-height-swift%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
an easy solution willl be to add simple UIView with 1px width and gray background where you need it.
– m1sh0
Nov 15 '18 at 8:35
Place the vertical line UILabels along with other text UILabels with some vertical space in top and bottom.
– Sateesh
Nov 15 '18 at 8:37
your stackView should contain only 3 labels with stackView.distribution = .fillEqually. Then, with autolayout, you clip 2 vertical insets views of 1 px width to the rightAnchor of the 2 first labels from the left. With autolayout, you can adjust the padding of the vertical inset views so that their height is less than your labels' heights
– Laurent Maquet
Nov 15 '18 at 8:54