views:

181

answers:

1

Hi,

I have problems with NSScrollView, It is not displayed the way I want. Yes I know there is a lot of post about it around the web, I need to override the isFlipped, in order to make it return YES, in my NSView subclass.

Ok, it's done, so now, my scrollView scroll from top to bottom, and not in the reverse way, as it was before overriding isFlipped.

But, this is the second part, my real problem, which I didn't found any answer on the web, how the hell I'm supposed to code, or create my view in interface builder, if everything is flipped? If I put something at the top, it is displayed a the bottom… do you have any magic trick to handle that?

And my last problem, is the NSScrollView frame. before setting the documentView of my scroll view, everything is fine, the scrollView is displayed at the place I choose, but, when I set the document view, it looks like the scrollview frame looks bigger, so I have to resize it…. is this a normal behavior?

Thank you very much.

A: 

Being flipped only applies its coordinate system to that exact view, not everything down the whole view hierarchy. So whatever you're putting directly into your flipped content view needs to be aware that it's flipped, but nothing else does.

And if you don't want it to work that way, just don't ask for it to be flipped! There's no rule that says that the document view of an NSScrollView has to be flipped, it's just very common for anything with variable-height content to be laid out top to bottom, which is easiest to do in a flipped view. If the layout you're doing works best as bottom-anchored, by all means, keep it unflipped, whatever's easiest. (And anything in Interface Builder should be fine anyway…did you actually see this problem, or are you just speculating that it might happen? I've never seen this issue…)

Setting the document view shouldn't change the size of the NSScrollView. You may have something else going on besides just that…

bdrister
Ok. So if I flip my documentView, I need to subclass every view I add, to override their isFlipped method, right?And, I think I will need to keep going the flipped way, because reading from top to bottom is more common, I think if we were scrolling from bottom to top in Pages, it will be weird ^^Nope, I'm not speculating, I've already flipped my view, and designed it in IB, and it draws everything flipped.Thank you.I'll add some screenshots of the scrollView's resizing problem and the IB view displayed flipped. So if anybody have an idea, viewing it, will be easier to understand it.
StrAbZ