Questions tagged [nsstackview]

The `NSStackView` is an OS X AppKit class introduced in OS X 10.9. It represents a horizontal or vertical stack of views.

From Apple's docs:

(NSStackView) is used to layout horizontal or vertical stacks of views using auto layout. Necessary constraints will automatically be created and modified when adding and removing views from a stack view to maintain a cohesive layout. This behavior is extended by customizing various properties of the stack view and the views it holds. Decreasing the clipping resistance priority allows the stack view to become smaller than the the minimum required to hold the provided views. Depending on the visibility priority associated with the internal views, they may either overflow and clip off the side, or drop from the view hierarchy. These dropped views are still retained by the stack view, and will be reattached if the stack view becomes the necessary size. Views can be forced to be dropped or reattached by setting the necessary visibility priority.

47 questions
0
votes
1 answer

How to resize an NSImageView in an NSStackView?

I'm working on a project where I want the following in an NSTableViewCell: Image Text Subtitle text The NSTableView is in a window which the user can expand or contract. When the window expands and contracts, the text wraps as needed. That much…
0
votes
0 answers

StackView Strangeness in Swift

I'm trying to make a little close simplification, and I seem to have missed something basic. I want the following snippet: let updateStackView = NSStackView(views: [updateField]) updateStackView.orientation = .horizontal …
wblj
  • 21
  • 3
0
votes
0 answers

How to adjust NSStackView to full height of subviews

I have the following Swift script: #!/usr/bin/env swift import AppKit import Foundation let app = NSApplication.shared app.setActivationPolicy(.regular) // Magic to accept keyboard input and be docked! struct DialogError: Error, LocalizedError…
Gabriel
  • 8,990
  • 6
  • 57
  • 101
0
votes
2 answers

Align control inside NSStackView

I've got NSWindows implementation that is used as modal authorization dialog. The code: using System; using AppKit; using Cairo; namespace SomeNameSpace { public class DialogWindow : NSWindow { public DialogWindow() : base() { var…
Keltar Helviett
  • 638
  • 1
  • 7
  • 13
0
votes
1 answer

NSStackView, fill view when one of the subviews is hidden

I have a vertical NSStackView that has this behavior. It has two subviews, one of them at top of the stack view, that will have a fixed height. Then, there is another view that will cover the remaining space in the view. Similar to the image below.…
Jacobo
  • 1,259
  • 2
  • 19
  • 43
0
votes
0 answers

How to align buttons on row using stack views without growing label

I have 3 buttons and I want to align them to left and right. Previously I was using growing label to align them. Is there a way how to achieve this without growing label? What distribution + hugging priorities etc. should I use to get correct…
Marek H
  • 5,173
  • 3
  • 31
  • 42
0
votes
1 answer

Custom NSView with NSStackView

I am trying to implement NSStackView with always the same custom view. So I have define my xib file, linked everything inside my class, associated the class, ... but I am sure I am missing something because the content inside the view don't appear.…
MrPOHB
  • 31
  • 4
0
votes
1 answer

macOS NSTextField,NSStackView,NSScrollView How to achieve wrapped text in a scrollable list?

New to macOS development and trying to create some very basic layouts, however I'm struggling to add NSTextFields to a NSStackView situated within an NSScrollView, thus far I have wrote the following however it seems to restrict the text to a single…
EM77
  • 35
  • 4
0
votes
1 answer

Whats the best way in Swift to animate an array of NSViews to appear one after another in an NSStackView?

I'm able add a number of NSTextFields to an NSStackView using the following code: optionsStackView.addView(newOption, in: .center) The problem I'm encountering is getting each NSTextField (newOption) to appear one after another when the view appears…
0
votes
1 answer

Embedding NSStackView as NSTableCellView in NSTableView

I'm currently working on a prototype for a todo type app. I have a table which contains the user tasks. What I want to do is only present the user with pertinent task information. But to edit additional information, they would click on a disclosure…
Mobile Ben
  • 7,121
  • 1
  • 27
  • 43
0
votes
1 answer

Why is only one subview visible when adding to NSStackView

I am trying to add a few NSTextFields to a horizontal stack view programmatically but the StackView only ever has one field visible and the field is not arranged correctly. for item in ArrayOfStrings { let view = NSTextField() …
Duncan Groenewald
  • 8,496
  • 6
  • 41
  • 76
0
votes
2 answers

NSStackView / NSScrollView - bisected NSStackview subview?

this is going to be hard to explain. I am modifying the InfoBarStackView sample code from Apple. The problem that I am encountering, is that it looks as if one of the subviews is being divided in two, by NSStackview and rendered separately. In my…
0
votes
1 answer

Fill NSStackView with NSArray and NSMutableArray

I have a Stack to fill with an array of views. _countViewArray = [[NSArray alloc] init]; _countViewArray = @[self.a.view,self.b.view,self.c.view]; _stackView = [NSStackView stackViewWithViews:_countViewArray]; It's work well. If I want replace this…
Joannes
  • 2,569
  • 3
  • 17
  • 39
0
votes
1 answer

NSStackView does not layout views properly

I've just started experimenting with NSStackView, and I'm having a very interesting problem which I can't solve. I've scoured the auto layout guides on Apple's website as well as the NSStackView documentation, and can't seem to find anything. My…
SevenBits
  • 2,836
  • 1
  • 20
  • 33
0
votes
1 answer

why with ios7 My stackViewController put this white line?

Why there is this white space at bottom-left? it wasn't here on ios6 compiled version and i can't understand how to remove it. My nib file hasn't it (the top level view is large as you see (20 pixel left from the image) and controller side there…
Alessio Crestani
  • 1,602
  • 4
  • 17
  • 38