Programmatically scroll NSScrollView to the right

前端 未结 2 1468
野趣味
野趣味 2021-01-16 18:29

Everything is in the title; I want to programmatically scroll an NSScrollView to the right so I can see the end of my document.

I tried this :



        
2条回答
  •  旧巷少年郎
    2021-01-16 18:31

    Try

    let toRight = CGRect(x: width, y: 0, width: 0, height: height)
    scrollView.scrollRectToVisible(toRight)
    

提交回复
热议问题