Skip to main content

Questions tagged [nsshadow]

An NSShadow object encapsulates the attributes used to create a drop shadow during drawing operations. Available in iOS 6.0 and later in UIKit and available in OS X v10.3 and later in AppKit.

0 votes
1 answer
174 views

CALayer shadowPath ignored on rendering as image

I am making an app that uses CAlayer to show contents like image in a NSWindow. The layer has shadows styled with shadowPath to make a better appearance. Finally to save/export the whole CAlayer and ...
vigu's user avatar
  • 31
1 vote
1 answer
261 views

How to make a shadow on iOS13

I set shadow on NSMutableAttributedString, it works on other version of iOS but not iOS 13, the next is my code let shadow = NSShadow.init() shadow.shadowColor = UIColor.red ...
danfei91's user avatar
1 vote
1 answer
390 views

Swift - Where is shadowOpacity on NSShadow?

I just discovered the unfortunate fact that setting the shadow properties of an NSView's backing layer on macOS does not cause the shadow to render. It seems that this only works for stand-alone ...
jeremyabannister's user avatar
2 votes
0 answers
206 views

NSWindow shadow with transparency, how to clip certain area

In our OS X application, we have enabled window shadow by view.window?.hasShadow = true. This will create a fine shadow over NSWindow. We have created a hole in the application by a custom view to see ...
Abdul Rahuman's user avatar
0 votes
1 answer
56 views

Shadow is drawn in "main" Storyboard but not in any other storyboard

I try to write my own comboBox as NSComboBox does not has features I need. So, I subclassed an NSTextField and monitor the textinput and depending of the stringValue a TableView will get it's data. ...
MatzeLoCal's user avatar
5 votes
0 answers
227 views

CATextLayer ignores NSShadow?

I have a custom UIView that I've created that has several custom UIControl instances which are non-rectangular buttons (instead of using UIButton instances). I am doing this because I need to be able ...
mbm29414's user avatar
  • 11.6k
1 vote
2 answers
327 views

Objective C - OS X - Issue adding NSShadow to NSImageView

I am trying to add a shadow to a NSImageView on an MAC application. I created a custom NSImageView class "ShadowView.h" and modified the drawRect: like so: - (void)drawRect:(NSRect)dirtyRect { [...
Leonardo Murri's user avatar
2 votes
0 answers
992 views

NSShadowAttributeName not working

Can anyone see what is wrong in the following Swift code? func myFunction(color:UIColor) {// Changes the Shadow color on textLabel var attributes = textLabel.attributedText?.attributesAtIndex(0, ...
Michel's user avatar
  • 11.4k
1 vote
1 answer
806 views

NSShadow set() method in iOS

In Apple's documentation for NSShadow in UIKit, they state: An NSShadow object may be used in one of two ways. First, it may be set, like a color or a font, in which case its attributes are applied ...
varkor's user avatar
  • 509
3 votes
1 answer
317 views

Cannot get a drop shadow on multiline nsstring

I'm trying to get multiline text to draw with a drop shadow without using deprecated APIs. It works fine for a single line. The relevant code looks like this: -(void)drawRect:(CGRect)rect { ...
Airsource Ltd's user avatar
1 vote
1 answer
127 views

Creating NSShadow makes an error

I'm making a white shadow in Objective-C and using the code NSShadow *myShadow = [[NSShadow alloc]init]; [myShadow setShadowColor: [UIColor whiteColor]]; and it seems to work fine, but when I'm ...
turingtested's user avatar
  • 6,944
1 vote
1 answer
1k views

Using NSShadow on Navigation Bar Button Items in iOS 7

I have a navigation bar that looks like so: It was created with the following code: // AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)...
JWK's user avatar
  • 3,670
6 votes
0 answers
427 views

Draw shadow of layer-backed NSView beyond bounds

I'd like to get a custom NSShadow on a borderless NSWindow, and since I'm also applying some animations on the window, I've set up the window's content view to be layer-backed. When applying the ...
Raffael's user avatar
  • 1,119
3 votes
3 answers
5k views

How to add shadow to NSView

I've spent some time trying to figure out how to add a shadow to an NSView. For now, I am attempting to use the NSShadow class to accomplish this. My code is below. I am attempting to create the ...
Jack Humphries's user avatar
4 votes
1 answer
1k views

Custom NSWindow with a custom shadow

I have a NSWindow subclass, looking like this The thing that bothers me is that I would like to alter the shadow. Over a standard window, like Xcode right here, the contrast is a little weak. So I'd ...
IluTov's user avatar
  • 6,834

15 30 50 per page