uistackview

UIStackView: Loading views from xib and updating height constraint of subView did not reflecting any changes?

…衆ロ難τιáo~ 提交于 2019-12-01 17:25:16
I have the following hierarchy in my application - UIScrollView - UIStackView - UIView 1 // load with xib and added in arrangedSubviews - UIScrollView 1.1 // horizontal scrolling, fixed height constraint 38 - UIView 1.2 // called it childView. has fixed height 0 (I load the view from xib and add it here dynamically and update its height) - UIView 1.2.1 // called it New View - UIView 2 - UIView 3 So my problem is when I have loaded a view from xib and added it to UIView1.2 also increased height constraint 0 to a height of newly added sub-view but nothing will happen. UIView1.2 height did not

UIStackView: Loading views from xib and updating height constraint of subView did not reflecting any changes?

丶灬走出姿态 提交于 2019-12-01 16:54:57
问题 I have the following hierarchy in my application - UIScrollView - UIStackView - UIView 1 // load with xib and added in arrangedSubviews - UIScrollView 1.1 // horizontal scrolling, fixed height constraint 38 - UIView 1.2 // called it childView. has fixed height 0 (I load the view from xib and add it here dynamically and update its height) - UIView 1.2.1 // called it New View - UIView 2 - UIView 3 So my problem is when I have loaded a view from xib and added it to UIView1.2 also increased

Can you give UIStackView borders?

夙愿已清 提交于 2019-11-30 17:06:16
I'm trying to give 5 separate UIStackViews in my ViewController borders. I gave each of them an IBOutlet and then called them in viewDidLoad to use the layer property but to no avail. Is it not possible to give stack views borders, programatically? Code: @IBOutlet weak var stackView1: UIStackView! @IBOutlet weak var stackView2: UIStackView! @IBOutlet weak var stackView3: UIStackView! @IBOutlet weak var stackView4: UIStackView! @IBOutlet weak var stackView5: UIStackView! override func viewDidLoad() { super.viewDidLoad() stackView1.layer.borderWidth = 5 stackView2.layer.borderWidth = 5

How can I create UIStackView with variable spacing between views?

笑着哭i 提交于 2019-11-30 10:53:50
问题 I have a simple horizontal UIStackView with several UIViews stacked inside. My goal is to create variable spacing between views. I am well aware that I can create constant space between the subviews using "spacing" property. However my goal is to create variable space. Please note, if at all possible, I would like to avoid using invisible views that act as spacers. The best I came up with was to wrap my UIViews in a separate UIStackView , and use layoutMarginsRelativeArrangement = YES to

Dynamic UITableView row height using UIStackView?

你。 提交于 2019-11-30 10:40:27
问题 Surprised this isn't working out of the box, as this seems to be an important use case for stack views. I have a UITableViewCell subclass which adds a UIStackView to the contentView. I'm adding labels to the stack view in tableView(_cellForRowAtIndexPath:) and the tableview is set to use dynamic row heights, but it doesn't appear to work, at least in Xcode 7.3. I was also under the impression that hiding arranged subviews in a stack view was animatable, but that seems broken as well. Any

How to set height of containers in stack view?

只愿长相守 提交于 2019-11-30 09:05:48
I'd like to ask you if it's possible to set height in percentage of each container placed in vertical stack view? I want to have 3 containers in stack view. First should take 40% of screen size, second 20% and third 40%. Thank you 'Fill proportionally' distribution type works with intrinsic content size . So if our vertical stack(height say 600) view has 2 views, ViewA (intrinsic content height 200) and ViewB(intrinsic content height 100), the stack view will size them to ViewA(height 400) and ViewB(height 200). Also, If all the views do not have intrinsic content height, vertical stack view

UIStackView with UILabels in Xcode 7.3

你说的曾经没有我的故事 提交于 2019-11-30 08:22:52
问题 Since I've updated to Xcode 7.3 I have a problem with UIStackView . If I create an empty project and just put two UILabel s in UIStackView with default hugging and compression priorities, it shows me AutoLayout misplacement error. It even doesn't work with one(!) UILabel in UIStackView , so priorities doesn't matter (as I think, maybe there is the problem). As I remember in Xcode prior 7.3 everything was fine. I checked on two MacBook Pro separately, it's the same issue. Does anybody know how

UIStackView “Unable to simultaneously satisfy constraints” on “squished” hidden views

若如初见. 提交于 2019-11-30 06:14:58
问题 When my UIStackView "rows" are squished, they throw AutoLayout warnings. However, they display fine and nothing else is wrong besides these sorts of loggings: Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing

How can I create UIStackView with variable spacing between views?

隐身守侯 提交于 2019-11-29 23:31:07
I have a simple horizontal UIStackView with several UIViews stacked inside. My goal is to create variable spacing between views. I am well aware that I can create constant space between the subviews using "spacing" property. However my goal is to create variable space. Please note, if at all possible, I would like to avoid using invisible views that act as spacers. The best I came up with was to wrap my UIViews in a separate UIStackView , and use layoutMarginsRelativeArrangement = YES to respect layout margins of my inner stack. I was hoping I could do something similar with any UIView without

Dynamic UITableView row height using UIStackView?

霸气de小男生 提交于 2019-11-29 22:24:11
Surprised this isn't working out of the box, as this seems to be an important use case for stack views. I have a UITableViewCell subclass which adds a UIStackView to the contentView. I'm adding labels to the stack view in tableView(_cellForRowAtIndexPath:) and the tableview is set to use dynamic row heights, but it doesn't appear to work, at least in Xcode 7.3. I was also under the impression that hiding arranged subviews in a stack view was animatable, but that seems broken as well. Any ideas on how to get this working correctly? class StackCell : UITableViewCell { enum VisualFormat: String {