nsscrollview

Accessibility: ScrollView to auto scroll to the view which are not visible on hitting “TAB”

拥有回忆 提交于 2019-12-10 13:23:17
问题 Could someone let me know how can I automatically scroll the scrollView when a keyboard-only user tries to navigate between different UI Element in the ScrollView using ‘Tab’ key? When I hit "TAB" key the focus is shifted to different UI element present in the scrollView but it doesn't scroll if the UI Element is not present in the Visible Content View. How can this be achieved. Help would be appreciated. Thanks. 回答1: Solution A: Create a subclass of NSWindow and override makeFirstResponder:

Image inside NSScrollView drawing on top of other views

亡梦爱人 提交于 2019-12-10 10:59:35
问题 I have a custom NSView that lives inside of a NSScrollView that is in a NSSplitView . The custom view uses the following drawing code: - (void)drawRect:(NSRect)dirtyRect { NSGraphicsContext *ctx = [NSGraphicsContext currentContext]; [ctx saveGraphicsState]; // Rounded Rect NSRect rect = [self bounds]; NSRect pathRect = NSMakeRect(rect.origin.x + 3, rect.origin.y + 6, rect.size.width - 6, rect.size.height - 6); NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:pathRect cornerRadius

Add lots of views to NSScrollView

北慕城南 提交于 2019-12-10 10:59:07
问题 I'm trying to add one subview (view from an NSViewController ) for every element in a dictionary to a NSScrollView to get kind of a tableview, but with much more flexibility over the cells. Is it possible to place (programmatically) e.g. 100 subviews underneath each other so that you have to scroll down the NSScrollView to get to the last element??? Thanks in advanced, Grolior 回答1: The short answer is yes. I have done this before, and I assure you that it will work. Let me also assure you

Stop NSScrollView only on specific values - Like UIScrollView paging

自闭症网瘾萝莉.ら 提交于 2019-12-10 01:39:57
问题 I am working on a Mac OS X app using SDK 10.7 as deployment target. A NSScrollView contains a horizontal list of image thumbnails. The thumbnail which is in the center of the ScrollView indicates the selected image which is shown below the ScrollView in full size. This works quite similar the the Finder Cover-Flow, beside that the images in my app do not flow but just scroll away. I would like to limit the scrolling to stop only when a thumbnail is exactly in the center. The NSView method

Scroller background not transparent in NSScrollView

耗尽温柔 提交于 2019-12-09 12:07:27
问题 Hi! I am using an NSScrollView which has a view-based NSTableView. Whenever the table adds a table cell the scrollers show up which is fine until you see that the scrollers don't have a transparent background. For some reason it's background is white as you can see on the image. I used IB to set up the NSScrollView and NSTableView and I cannot find any option where I can disable the scroller's background. Any ideas what may have cause this? Update: Settings for my NSScrollView in Xcode 回答1:

Two Finger Drag with IKImageView and NSScrollView in Mountain Lion

瘦欲@ 提交于 2019-12-08 10:38:19
问题 I have a Mac App that's been in the app store for a year or so now. It was first published with target SDK 10.7, Lion. Upon the update to Mountain Lion it no longer works. The application displays large images in an IKImageView which is embedded in an NSScrollView. The purpose of putting it into a scrollview was to get two finger dragging working, rather than the user having to click to drag. Using ScrollViewWorkaround by Nicholas Riley, I was able to use two finger scrolling to show the

How to embed a storyboard view controller in an NSScrollView OS X (10.10) to make a complex inspector view?

老子叫甜甜 提交于 2019-12-08 03:30:04
问题 I'm looking at WWDC 2014 video, "212: Storyboards and controllers on OS X". In this video they claim that Pages UI does/could be arranged using Storyboards on OS X (see below). However, in Pages UI the inspector view is very long and is embedded in a scroll view (you can verify this my two-finger scrolling in Page.app inspector view), also some inspector items are themselves contained in (some type of custom) disclosure view. It doesn't seem to be possible to embed a storyboard view

NSScrollView containing NSStackView. Why the NSStackView items from bottom to Top?

半城伤御伤魂 提交于 2019-12-07 06:36:50
问题 The NSScrollView containing a NSStackView. The NSStackView's items will add in runtime.The new NSStackView's items are from bottom to top, but I want they are from top to bottom. The main.storyboard The ViewController import Cocoa class ViewController: NSViewController { var todoList:[Todo] = [] @IBOutlet weak var todosStackView: NSStackView! @IBOutlet weak var todosScrollView: NSScrollView! @IBAction func onEnter(sender: NSTextField) { let todo = Todo() todo.content = sender.stringValue self

Layer-backed NSView performance with rendering directly in CALayer.drawInContext:

倖福魔咒の 提交于 2019-12-07 06:03:04
问题 I have many layer-backed views contained in a NSScrollview and am predominantly concerned with scrolling performance . The documentView and higher are layer-backed hence their subviews are also layer-backed. The following are the three natural places that display/rendering code could go: override NSView.wantsUpdateLayer to return false (or don't do anything because this is the default) & do drawing in NSView's drawRect method override NSView.wantsUpdateLayer to return true & do drawing in

Disable scrolling in NSTableView

纵饮孤独 提交于 2019-12-06 20:41:49
问题 Is there a simple way to disable scrolling of an NSTableView. It seems there isn't any property on [myTableView enclosingScrollView] or [[myTableView enclosingScrollView] contentView] to disable it. 回答1: This works for me: subclass NSScrollView, setup and override via: - (id)initWithFrame:(NSRect)frameRect; // in case you generate the scroll view manually - (void)awakeFromNib; // in case you generate the scroll view via IB - (void)hideScrollers; // programmatically hide the scrollers, so it