uistackview

StackView layout side by side & on Top of each other (like zStack)

你说的曾经没有我的故事 提交于 2021-02-11 12:50:57
问题 I currently have this interface whereby I am putting a MapView and a UIView on top of each other. The UIView is where I put my chart overlay (eg: Heart Rate). This is fine when the device is in portrait mode. However, I would like to explore a different layout when in landscape mode whereby the UIView(HR Chart) and the MapView is side by side. Is this doable in Interface Builder? Or only in code? (I would like to only use UIKit to better support lower OSes) note : I tried in IB but can't seem

StackView layout side by side & on Top of each other (like zStack)

三世轮回 提交于 2021-02-11 12:50:31
问题 I currently have this interface whereby I am putting a MapView and a UIView on top of each other. The UIView is where I put my chart overlay (eg: Heart Rate). This is fine when the device is in portrait mode. However, I would like to explore a different layout when in landscape mode whereby the UIView(HR Chart) and the MapView is side by side. Is this doable in Interface Builder? Or only in code? (I would like to only use UIKit to better support lower OSes) note : I tried in IB but can't seem

Bottom-align the text of a sequence of UILabels within a horizontal UIStackView

ε祈祈猫儿з 提交于 2021-01-28 04:37:37
问题 How do I programmatically align the text of a sequence of UILabels within a horizontal UIStackView so that all text is at the bottom of the views? Below is an image of what I have and what I want. I already know how to create the views, I just can't figure out what properties or constraints are needed to get the text to align on the bottom of the views. Thanks. 回答1: Related to what @mahbaleshwar mentioned, UILabels always center align. However, UIStackView has some properties that will help

StackView isHidden attribute not updating as expected

我只是一个虾纸丫 提交于 2020-12-28 15:00:47
问题 I'm trying to update a UIStackView so that a field displays, should the value of a UITextField equal "Other" . Here is my code: @IBOutlet var stackView: UIStackView! func updateView() { print("UPDATING") UIView.animate(withDuration: 0.25, animations: { () -> Void in if(self.myTextField.text! == "Other") { print("SHOWING") self.stackView.arrangedSubviews[3].isHidden = false } else { print("HIDING") self.stackView.arrangedSubviews[3].isHidden = true } print("Is hidden: \(self.stackView

Adding buttons programmatically to stackView in Swift

断了今生、忘了曾经 提交于 2020-12-08 05:16:30
问题 I've tried to add buttons dynamically/programmatically in UIStackView that I've built with interface builder but they failed to show up when I run the application. The number of buttons that's supposed to be added ranging normally from 4-6. Can you guys tell me what's wrong with the code 回答1: @Nowonder I just recreate what you are trying to achieve. The following are the steps. Add a UIStackView in viewController from Interface Builder and add required constraints. Add the following code.

Adding buttons programmatically to stackView in Swift

拟墨画扇 提交于 2020-12-08 05:15:29
问题 I've tried to add buttons dynamically/programmatically in UIStackView that I've built with interface builder but they failed to show up when I run the application. The number of buttons that's supposed to be added ranging normally from 4-6. Can you guys tell me what's wrong with the code 回答1: @Nowonder I just recreate what you are trying to achieve. The following are the steps. Add a UIStackView in viewController from Interface Builder and add required constraints. Add the following code.

Why is my StackView not working? Elements are completely displaced

让人想犯罪 __ 提交于 2020-12-08 05:09:40
问题 Hey my StackView is doing nothing, there are two problems: The first is that the elements on the VC are completely displaced when I turn around the simulator or change the device, so the StackView is not doing what it should do! The second thing is that the StackView is covering the navigation bar and I don't know how to make it visible. Can someone help me? import UIKit class RegisterViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { let

Horizontal UIStackView with two label (one multiline label, one one-line)

◇◆丶佛笑我妖孽 提交于 2020-12-04 03:43:23
问题 I have a horizontal UIStackView which has two UILabel in it. First UILabel is multiline (two line) and other one is one line only. They both have default content compression and resistance priorities. My problem is that even there is a gap between labels, "best" word in first text goes second line. I noticed that first label doesn't goes beyond half of total width. What I want is that second label should always show itself and first label should size It self for remaining space. If It can't

Horizontal UIStackView with two label (one multiline label, one one-line)

旧巷老猫 提交于 2020-12-04 03:43:21
问题 I have a horizontal UIStackView which has two UILabel in it. First UILabel is multiline (two line) and other one is one line only. They both have default content compression and resistance priorities. My problem is that even there is a gap between labels, "best" word in first text goes second line. I noticed that first label doesn't goes beyond half of total width. What I want is that second label should always show itself and first label should size It self for remaining space. If It can't

Horizontal UIStackView with two label (one multiline label, one one-line)

孤人 提交于 2020-12-04 03:39:19
问题 I have a horizontal UIStackView which has two UILabel in it. First UILabel is multiline (two line) and other one is one line only. They both have default content compression and resistance priorities. My problem is that even there is a gap between labels, "best" word in first text goes second line. I noticed that first label doesn't goes beyond half of total width. What I want is that second label should always show itself and first label should size It self for remaining space. If It can't