Search Unity

scollview handle doesn't move when i drag

Discussion in 'UGUI & TextMesh Pro' started by steveh2112, Jan 18, 2020.

  1. steveh2112

    steveh2112

    Joined:
    Aug 30, 2015
    Posts:
    314
    i created a scrollview and inside content i added a vertical layout group and a content size fitter and for testing i add about 20 or so text objects as children of content (i also did it from script but i simplified things for the test by adding them in the editor)

    so the items display ok, (except for getting cut off at the bottom which i think is a problem related to the size of the rect) and scroll ok but the scroll handle never moves, its stays stuck at the top of the sliding area

    i have no scripts running on it

    any ideas? thanks

    BTW, the scrollview is 400 high and i set the content rect bottom at -800 to fit everything in, but i'm sure i need to make that size dynamic based on the size of the contents, so that's another, possibly related question
     
    Last edited: Jan 18, 2020
  2. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    This happens if you don't assign the scrollbar to the ScrollRect, or if the handle has Interactable=false. I can't think of anything else that could cause it.

    You can try removing and adding a new Scrollbar, making sure its direction is "Bottom to top" or "Top to bottom", if you have a vertical scroll view.

    Assuming this is a vertical scroll view.
    You don't need to set its bottom manually. You only set the desired width (usually same as the viewport), because the content is automatically resized by the ContentSizeFitter (set Vertical Fit to Preferred Size). Also, you can move the Content's pivot up/down/center to decide where the content will be positioned when it's smaller than viewport
     
  3. steveh2112

    steveh2112

    Joined:
    Aug 30, 2015
    Posts:
    314
    thanks but i deleted the scrollview and made a new one and its ok, so i think something i did with the rect layout and stretch messed it up, but ok now
     
    xucian likes this.