Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How I set the default position of a NSScroll view?

I have a trouble with a NSScrollview in my aplication because it always start at the bottom of the window. How could make it start in the top?

like image 817
Javier Beltrán Avatar asked Apr 29 '11 15:04

Javier Beltrán


People also ask

How do I set scroll position to zero?

If you want to set the scroll position of document. body , you can scroll the entire window altogether using window. scrollTo() ; it takes either a pair of coordinates (x,y) or an options object – if you just want to scroll nicely to the top, try window. scrollTo({top:0,behavior:'smooth'}); .

What is fillViewport in ScrollView?

fillViewport allows scrollView to extend it's height equals to the full height of device screen's height in the cases when the child of scroll view has less height.

What is the difference between NestedScrollView and ScrollView?

NestedScrollView is just like ScrollView, but it supports acting as both a nested scrolling parent and child on both new and old versions of Android. It is enabled by default. NestedScrollView is used when there is a need for a scrolling view inside another scrolling view.

Is List view scrollable by default?

ListView itself is scrollable.


1 Answers

Try something like this:

NSPoint pointToScrollTo = NSMakePoint (  ,  );  // Any point you like.
[[scrollView contentView] scrollToPoint: pointToScrollTo];
[scrollView reflectScrolledClipView: [scrollView contentView]];
like image 61
Anne Avatar answered Sep 28 '22 11:09

Anne