public float elasticity ;

描述

在内容移动至滚动矩形之外时使用的弹性值。

默认值为 0.1。仅当 movementType 设置为“Elastic”时,才使用弹性。

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class ExampleClass : MonoBehaviour { public ScrollRect myScrollRect;

public void Start() { // assigns a new value to the elasticity of the scroll rect. // The higher the number the longer it takes to snap back. myScrollRect.elasticity = 3.0f; } }