Questions tagged [uistackview]

The UIStackView class provides a streamlined interface for laying out a collection of views in either a column or a row. Stack views let you leverage the power of Auto Layout, creating user interfaces that can dynamically adapt to the device’s orientation, screen size, and any changes in the available space.

The UIStackView class provides a streamlined interface for laying out a collection of views in either a column or a row. Stack views let you leverage the power of Auto Layout, creating user interfaces that can dynamically adapt to the device’s orientation, screen size, and any changes in the available space. The stack view manages the layout of all the views in its arrangedSubviews property. These views are arranged along the stack view’s axis, based on their order in the arrangedSubviews array. The exact layout varies depending on the stack view’s axis, distribution, alignment, spacing, and other properties.

enter image description here

To use a stack view, open the Storyboard you wish to edit. Drag either a Horizontal Stack View or a Vertical Stack View out from the Object library, and position the stack view where desired. Next, drag out the stack’s content, dropping the view or control into the stack. You can continue to add views and controls to your stack, as needed. Interface Builder resizes the stack based on its content. You can also adjust the appearance of the stack’s content by modifying the Stack View’s properties in the Attributes inspector.

1429 questions
1
vote
0 answers

BUG: Hide / Show multiple views arranged in stack view at once

We wanted to hide and show single or multiple views arranged in stack view whenever it is required. So, all what we did is simply: stackView.arrangedSubviews[0].isHidden = false stackView.arrangedSubviews[1].isHidden =…
Nural Me
  • 19
  • 1
1
vote
1 answer

How make a view take all remaining space into a vertical stackview?

I have a vertical stack view with 3 views. I want my second view to be fixed (height) and the top and the bottom view to take all remaining space (and so that the second view will be centered...) I've tried putting my top and bottom view with…
Hiromi
  • 209
  • 1
  • 3
  • 12
1
vote
0 answers

How do I synchronise zooming/scrolling/panning for multiple ios charts?

I have a page in my app that displays multiple (16) charts using Daniel Gindi's Charts library. I have them arranged in a stackview so that I can toggle their display on/off. I would like to be able to synchronise zooming/pannning/scrolling of the…
danaq
  • 117
  • 11
1
vote
1 answer

How can I put UICollectionViews in stackView?

I want to put 3 collectionViews in stackViews like this picture. However, when I simulate it, I cannot see collectionViews as I designed it. Here is my Design. 3 CollectionViews in StackView In the past, I had tried this solution from this site,…
1
vote
0 answers

UIStackView arranged sub view bottom arrangement problem

I want to start addArrangedSubview from bottom alignment as like as attached 2nd screenshot(3rd is my actual working screenshot). But every time it arranged from top to bottom. But I need it from bottom to top arrange. I want to create this…
AMIT
  • 906
  • 1
  • 8
  • 20
1
vote
2 answers

How to hide scrollbar in UIStackView?

I am using Xcode 10.1 and am programming using Swift in the ViewController.swift file. I have a horizontally scrolling UIStackView that works perfectly. The only issue is that the scrollbar appears whenever I begin to scroll. I looked online and…
1
vote
1 answer

IOS Swift nested vertical StackView

Is it a good practice to have nested vertical or horizontal StackViews in my project there is requirement to do so or is there any other way to avoid this or it is okay to use nested vertical StackViews. Storyboard looks like below it is working…
alphanso
  • 409
  • 5
  • 22
1
vote
1 answer

How to make a single UIStackView's row height dynamically adjusted to fill the entire screen?

I'm having the following layout: I want the Stack View to fill the entire screen. I want the green View to behave like a space between the above rows and the bottom view. The green row should have a minimum height (like 20 points) and it should…
Zbarcea Christian
  • 9,367
  • 22
  • 84
  • 137
1
vote
0 answers

What can cause UIStackView subviews to collapse?

I'm programmatically building a vertical UIStackView to show 3 short UILabel's: import UIKit import PlaygroundSupport let box = UIView(frame: CGRect(origin: CGPoint(x:0, y:0), size: CGSize(width: 100, height: 100))) box.backgroundColor =…
Srg
  • 510
  • 4
  • 13
1
vote
0 answers

When I add uibuttons to stack view they appear on top of each other

I'm developing a quiz app and I want to display a question with corresponding choices but only one right answer. The amount of corresponding for each question varies on the question (some have 2,3,4, etc.). The choices are displayed through…
1
vote
0 answers

Resizing UIStackView when hiding a subview?

I have a UIStackView with the config below, when i hide its first subview i want it to shrink in height rather than redistributing the height of the existing cells to fill or leaving white space. Is there a way to achieve this? as currently it wont…
jwarris91
  • 902
  • 9
  • 24
1
vote
2 answers

What control to use to capture image from camera and show on ui as thumbnail with events xamarin ios

I have created a view like this in my xamarin iOS mobile project. User will be able to click on the capture images button to take a picture and set the image property of the image view. I would like to know how can i allow the user longpress a…
Abe
  • 1,879
  • 2
  • 24
  • 39
1
vote
0 answers

How can I use .scaleAspectFit and .top to properly align my image inside the UIImageView?

I can't seem to figure out a way to align my image to the top of this UIImageView, while also using .scaleAspectFit. I've highlighted the ImageView in blue so you can see what's happening. As you can see the image is being vertically centered, but I…
unicorn_surprise
  • 951
  • 2
  • 21
  • 40
1
vote
0 answers

Change the Height of HeaderView inside tableviewSection with Animation + UIStackView

I have an one Tableview. inside tableview at i insert a stack view which contain the 2 view(Blue and Gray) with FillEqually. now i face the issue while hide a one view(Blue). the another view(Gray) take place of it and make it bigger. the height of…
Pushp
  • 1,064
  • 10
  • 18
1
vote
1 answer

ScrollView with StackView and fixed footer outside

Xcode 10, Swift 5 (this should be doable purely in the Storyboard) The current layout: - ChildView (child View of very first default view) - ButtonView - ScrollView - VerticalStackView - Button …
Neph
  • 1,823
  • 2
  • 31
  • 69