# NSScrollview scrolling

**URL:** <https://forums.kodeco.com/t/nsscrollview-scrolling/20432>\
**Category:** Swift\
**Created:** [September 28, 2016, 8:48am UTC](https://forums.kodeco.com/t/nsscrollview-scrolling/20432 "2016-09-28T08:48:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fritz](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/fritz/32/81494_2.png) [@fritz](https://forums.kodeco.com/u/fritz)\
**Post date:** [September 28, 2016, 8:48am UTC](https://forums.kodeco.com/t/nsscrollview-scrolling/20432/1 "2016-09-28T08:48:01Z")

</div>

Hi !  
I have a problem with scrolling (and zooming) an NSView in A NSScrollView.  
I have a View (fixed size 3000,2000) that I embedded into a scrollview.  
When I scroll to the right bottom end, every looks fine. But when I increase the size of the window the view expands.  
**Is this the normal behavior?**  
**How can I limit the displayed view to its fixed sizes?**  
**How do I set the size of the NSView programmatically?**  
(I want to have portrait and landscape)

Scrolling:  
[https://github.com/frcocoatst/ScrollViewTest](https://github.com/frcocoatst/ScrollViewTest)

I added some zooming feature, but here I have some clipping problems  
Zooming

[https://github.com/frcocoatst/ScrollViewTestZooming](https://github.com/frcocoatst/ScrollViewTestZooming)

Kind Regards,  
Fritz

---

<div class="post-metadata">

**Author:** ![fritz](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/fritz/32/81494_2.png) [@fritz](https://forums.kodeco.com/u/fritz)\
**Post date:** [September 29, 2016, 2:50pm UTC](https://forums.kodeco.com/t/nsscrollview-scrolling/20432/2 "2016-09-29T14:50:16Z")

</div>

> [@fritz](#):
>
> Scrolling:[GitHub - frcocoatst/ScrollViewTest: Test of NSScrollview in Swift3](https://github.com/frcocoatst/ScrollViewTest)

The scrolling problem is fixed now by adding constraints.

> **[GitHub - frcocoatst/ScrollViewTest: Test of NSScrollview in Swift3](https://github.com/frcocoatst/ScrollViewTest)**
>
> Test of NSScrollview in Swift3. Contribute to frcocoatst/ScrollViewTest development by creating an account on GitHub.

But I would prefer to set the dimensions of the view in code.

I still have no idea how to fix the zooming …

> **[GitHub - frcocoatst/ScrollViewTestZooming: Test of NSScrollview and Zooming...](https://github.com/frcocoatst/ScrollViewTestZooming)**
>
> Test of NSScrollview and Zooming in Swift3 . Contribute to frcocoatst/ScrollViewTestZooming development by creating an account on GitHub.

Kind Regards,  
Fritz
