Rick
Rick

Reputation: 381

How to change border color of NSScrollView?

I could customise border type through -[NSScrollView setBorderType:], but what about border color?

Upvotes: 2

Views: 1520

Answers (2)

Klajd Deda
Klajd Deda

Reputation: 375

To make https://github.com/beretboat/ScrollViewBorder work, you'd have to "Embed In" the scroll in a view. Than set the borders on that view. The NSScrollView is not your typical NSView.

Upvotes: 0

TheHungryCub
TheHungryCub

Reputation: 1960

1

Import QuartzCore framework to your App.

2

Then import that in .h file on which class where you want to set the border. like:

#import <QuartzCore/QuartzCore.h>

3

Try this for setup of your border, I hope it help you:

myScrollView.layer.cornerRadius=10.0f;
self.myScrollView.wantsLayer = TRUE;

myScrollView.layer.masksToBounds=YES;
myScrollView.layer.borderColor=[[UIColor redColor]CGColor];//change according to your requirement.
myScrollView.layer.borderWidth= 1.0f;

Upvotes: 2

Related Questions