{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Class SwipeView | App UI | 0.6.5
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SwipeView

    A SwipeView is a container that displays one or more children at a time and provides a UI to navigate between them. It is similar to a ScrollView but here children are snapped to the container's edges. See PageView for a similar container that includes a page indicator.

    Inheritance
    object
    CallbackEventHandler
    Focusable
    VisualElement
    SwipeView
    Implements
    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    INotifyValueChanged<int>
    Inherited Members
    VisualElement.disabledUssClassName
    VisualElement.ExecuteDefaultAction(EventBase)
    VisualElement.Focus()
    VisualElement.SendEvent(EventBase)
    VisualElement.SetEnabledFromHierarchy(bool)
    VisualElement.SetEnabled(bool)
    VisualElement.MarkDirtyRepaint()
    VisualElement.ContainsPoint(Vector2)
    VisualElement.Overlaps(Rect)
    VisualElement.DoMeasure(float, VisualElement.MeasureMode, float, VisualElement.MeasureMode)
    VisualElement.ToString()
    VisualElement.GetClasses()
    VisualElement.ClearClassList()
    VisualElement.AddToClassList(string)
    VisualElement.RemoveFromClassList(string)
    VisualElement.ToggleInClassList(string)
    VisualElement.EnableInClassList(string, bool)
    VisualElement.ClassListContains(string)
    VisualElement.FindAncestorUserData()
    VisualElement.Add(VisualElement)
    VisualElement.Insert(int, VisualElement)
    VisualElement.Remove(VisualElement)
    VisualElement.RemoveAt(int)
    VisualElement.Clear()
    VisualElement.ElementAt(int)
    VisualElement.IndexOf(VisualElement)
    VisualElement.Children()
    VisualElement.Sort(Comparison<VisualElement>)
    VisualElement.BringToFront()
    VisualElement.SendToBack()
    VisualElement.PlaceBehind(VisualElement)
    VisualElement.PlaceInFront(VisualElement)
    VisualElement.RemoveFromHierarchy()
    VisualElement.GetFirstOfType<T>()
    VisualElement.GetFirstAncestorOfType<T>()
    VisualElement.Contains(VisualElement)
    VisualElement.FindCommonAncestor(VisualElement)
    VisualElement.viewDataKey
    VisualElement.userData
    VisualElement.canGrabFocus
    VisualElement.focusController
    VisualElement.usageHints
    VisualElement.transform
    VisualElement.layout
    VisualElement.contentRect
    VisualElement.paddingRect
    VisualElement.worldBound
    VisualElement.localBound
    VisualElement.worldTransform
    VisualElement.pickingMode
    VisualElement.name
    VisualElement.enabledInHierarchy
    VisualElement.enabledSelf
    VisualElement.visible
    VisualElement.generateVisualContent
    VisualElement.experimental
    VisualElement.hierarchy
    VisualElement.cacheAsBitmap
    VisualElement.parent
    VisualElement.panel
    VisualElement.visualTreeAssetSource
    VisualElement.this[int]
    VisualElement.childCount
    VisualElement.schedule
    VisualElement.style
    VisualElement.customStyle
    VisualElement.styleSheets
    VisualElement.tooltip
    VisualElement.resolvedStyle
    Focusable.Blur()
    Focusable.focusable
    Focusable.tabIndex
    Focusable.delegatesFocus
    CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)
    CallbackEventHandler.HandleEvent(EventBase)
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    CallbackEventHandler.ExecuteDefaultActionAtTarget(EventBase)
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.AppUI.UI
    Assembly: solution.dll
    Syntax
    public class SwipeView : VisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, INotifyValueChanged<int>

    Constructors

    Name Description
    SwipeView()

    Default constructor.

    Fields

    Name Description
    containerUssClassName

    The styling class applied to the container of the SwipeView.

    noAutoPlayDuration

    The default duration of the auto play animation.

    ussClassName

    The main styling class of the SwipeView. This is the class that is used in the USS file.

    variantUssClassName

    The styling class applied to the SwipeView depending on its orientation.

    Properties

    Name Description
    autoPlayDuration

    The number of milliseconds between each automatic swipe.

    bindItem

    A method that is called when an item is bound to the SwipeView.

    canGoToNext

    Check if there is a next item or not.

    canGoToPrevious

    Check if there is a previous item or not.

    contentContainer

    The container of the SwipeView.

    count

    The total number of items.

    currentItem

    The current item.

    direction

    The orientation of the SwipeView.

    resistance

    The resistance of the SwipeView.

    By default, the SwipeView has a resistance of 1.

    If you set this property to more than 1, the SwipeView will be harder to swipe. If you set this property to less than 1, the SwipeView will be easier to swipe.

    skipAnimationThreshold

    This property determines the threshold at which the animation will be skipped.

    snapAnimationEasing

    The easing of the animation when snapping to an item.

    snapAnimationSpeed

    The speed of the animation when snapping to an item.

    sourceItems

    The source of items that are used to populate the SwipeView.

    startSwipeThreshold

    The amount of pixels that must be swiped before the SwipeView begins to swipe.

    swipeable

    Whether or not the SwipeView is swipeable.

    By default, the SwipeView is swipeable. If you set this property to false, you won't be able to interact with the SwipeView (except programmatically).

    unbindItem

    A method that is called when an item is unbound from the SwipeView.

    value

    The value of the SwipeView (i.e. the index of the current item).

    visibleItemCount

    The number of items that are visible at the same time.

    wrap

    This property determines whether or not the view wraps around when it reaches the start or end.

    Methods

    Name Description
    GoTo(int)

    Go to item at index.

    GoToNext()

    Go to next item.

    GoToPrevious()

    Go to previous item.

    SetValueWithoutNotify(int)

    Sets the value without notifying the listeners.

    SnapTo(int)

    Snap to item at index.

    Events

    Name Description
    beingSwiped

    The event that is called when the value of the SwipeView changes (i.e. when its being swiped or when it snaps to an item).

    Extension Methods

    VisualElementExtensions.FindNavController(VisualElement)
    VisualElementExtensions.GetChildren<T>(VisualElement, bool)
    VisualElementExtensions.GetContext(VisualElement)
    VisualElementExtensions.GetContextProvider<T>(VisualElement)
    VisualElementExtensions.GetContext<T>(VisualElement)
    VisualElementExtensions.GetPreferredTooltipPlacement(VisualElement)
    VisualElementExtensions.GetSelfContext<T>(VisualElement)
    VisualElementExtensions.GetTooltipTemplate(VisualElement)
    VisualElementExtensions.GetWorldBoundingBox(VisualElement)
    VisualElementExtensions.IsContextProvider<T>(VisualElement)
    VisualElementExtensions.ProvideContext<T>(VisualElement, T)
    VisualElementExtensions.RegisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.SetPreferredTooltipPlacement(VisualElement, PopoverPlacement)
    VisualElementExtensions.SetTooltipTemplate(VisualElement, VisualElement)
    VisualElementExtensions.UnregisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)