uistackview

How to align stack view vertically in center inside scroll view?

徘徊边缘 提交于 2020-05-17 06:07:44
问题 I've a stack view inside scroll view as shown in the image below. I want to align it vertically in center. It doesn't align vertically in center on iPhone 5S, it works fine on iPhone 11 Pro Max. I've seen this solution https://stackoverflow.com/a/50767533/12114641 and my implementation is exactly same. How do I fix it so that i aligns vertically in center on all devices? 来源: https://stackoverflow.com/questions/61829858/how-to-align-stack-view-vertically-in-center-inside-scroll-view

How to align stack view vertically in center inside scroll view?

微笑、不失礼 提交于 2020-05-17 06:07:34
问题 I've a stack view inside scroll view as shown in the image below. I want to align it vertically in center. It doesn't align vertically in center on iPhone 5S, it works fine on iPhone 11 Pro Max. I've seen this solution https://stackoverflow.com/a/50767533/12114641 and my implementation is exactly same. How do I fix it so that i aligns vertically in center on all devices? 来源: https://stackoverflow.com/questions/61829858/how-to-align-stack-view-vertically-in-center-inside-scroll-view

Add tap gesture to UIStackView

点点圈 提交于 2020-02-21 09:38:27
问题 Im attempting to add a UITapGesture to a UIStackView within a collectionView cell but each time I do my app crashes. (All IBOutlets are connected) This there something I'm doing wrong here? let fGuesture = UITapGestureRecognizer(target: self, action: #selector(self.showF(_:))) cell.fstackView.addGestureRecognizer(fGuesture) func showF(sender: AnyObject){ print(111) } 回答1: Is the stackview enabled for touch ? Try to set Userinteraction Parameter cell.fstackView.isUserInteractionEnabled = true

Increase area of UIButton in UIStackView

时光毁灭记忆、已成空白 提交于 2020-01-24 22:30:08
问题 I have couple of UIButtons embedded in UIStackView. I understand UIStackView takes only the intrinsic size of UIButton when laying it out. But I want to increase height/width of UIButton when inside UIStackView. Without UIStackView, I can easily increase or decrease UIButtons frame size. What is the deal with UIStackView? Detail: Let's say I gave 3 UIButtons with only UIImages and no text. Button 1 is 80x80, button 2 image is 30x30, button 3 image is 30x30. I would like touch area of button 2

Why is UIImageView.content mode ignored

本秂侑毒 提交于 2020-01-17 08:34:52
问题 I have a vertical UIStackView with three subviews and I want to center the content in all three of these subviews. I'm doing this all programmatically, not with the storyboard. I started by trying to use the storyboard and only adding the last arrangedSubview but that complicated things more. I've tried setting the '.contentMode` on the stack view itself, on each of the subviews, and all of them at the same time (as seen below). None of them have any affect - everything in these three

IOS stackview addArrangedSubview add at specific index

旧巷老猫 提交于 2020-01-12 06:31:09
问题 How is it possible to add a arranged subview in a particular index in a UIStackView? something like: stackView.addArrangedSubview(nibView, atIndex: index) 回答1: You mean you want to insert, not add: func insertArrangedSubview(_ view: UIView, atIndex stackIndex: Int) 来源: https://stackoverflow.com/questions/34434218/ios-stackview-addarrangedsubview-add-at-specific-index

IOS stackview addArrangedSubview add at specific index

风流意气都作罢 提交于 2020-01-12 06:30:49
问题 How is it possible to add a arranged subview in a particular index in a UIStackView? something like: stackView.addArrangedSubview(nibView, atIndex: index) 回答1: You mean you want to insert, not add: func insertArrangedSubview(_ view: UIView, atIndex stackIndex: Int) 来源: https://stackoverflow.com/questions/34434218/ios-stackview-addarrangedsubview-add-at-specific-index

IOS stackview addArrangedSubview add at specific index

我的未来我决定 提交于 2020-01-12 06:30:47
问题 How is it possible to add a arranged subview in a particular index in a UIStackView? something like: stackView.addArrangedSubview(nibView, atIndex: index) 回答1: You mean you want to insert, not add: func insertArrangedSubview(_ view: UIView, atIndex stackIndex: Int) 来源: https://stackoverflow.com/questions/34434218/ios-stackview-addarrangedsubview-add-at-specific-index

Multi Line Labels and an Image with UIStackView

≡放荡痞女 提交于 2020-01-06 08:13:53
问题 I am trying to see if I can easily use a UIStackView to create multi line labels and also display an image. Here are my current constraints. When I run it I get the following: If I remove the imageview then the multi line works. Somehow UIImageView width and height is messing up everything. What am I doing wrong? 回答1: Change height and width of the imageView to give proper look and don't give fixed height for the stackview, only give top, bottom, leading and trailing. THis is how it will look