Files
XRLib/Assets/Resources/UIToolkit/Sample/List/UTKScrollViewSample.uxml

46 lines
2.9 KiB
Plaintext
Raw Normal View History

2026-01-20 20:18:47 +09:00
<?xml version="1.0" encoding="utf-8"?>
<UXML xmlns="UnityEngine.UIElements" xmlns:utk="UVC.UIToolkit">
<Style src="../UTKSampleCommon.uss" />
<Style src="UTKListSample.uss" />
<VisualElement class="utk-sample-container">
<Label class="utk-sample-desc" text="스크롤 뷰 컴포넌트" />
<VisualElement class="utk-sample-section">
<Label class="utk-sample-section__title" text="ScrollViews" />
<VisualElement class="utk-sample-row">
<!-- Vertical Scroll -->
<utk:UTKScrollView name="scroll-vertical" class="utk-sample-scrollview">
<Label text="Vertical Item 1" />
<Label text="Vertical Item 2" />
<Label text="Vertical Item 3" />
<Label text="Vertical Item 4" />
<Label text="Vertical Item 5" />
<Label text="Vertical Item 6" />
<Label text="Vertical Item 7" />
<Label text="Vertical Item 8" />
<Label text="Vertical Item 9" />
<Label text="Vertical Item 10" />
<Label text="Vertical Item 11" />
<Label text="Vertical Item 12" />
<Label text="Vertical Item 13" />
<Label text="Vertical Item 14" />
<Label text="Vertical Item 15" />
</utk:UTKScrollView>
<!-- Horizontal scroll will be created via C# -->
<VisualElement name="horizontal-scroll-container" class="utk-sample-scrollview" />
<!-- Both scroll will be created via C# -->
<VisualElement name="both-scroll-container" class="utk-sample-scrollview" />
</VisualElement>
</VisualElement>
2026-01-21 20:43:54 +09:00
<!-- Code Sample -->
<VisualElement class="utk-code-sample-container">
<utk:UTKCodeBlock title="C#" code="// 기본 스크롤 뷰&#10;var scrollView = new UTKScrollView();&#10;scrollView.Add(new Label(&quot;내용 1&quot;));&#10;scrollView.Add(new Label(&quot;내용 2&quot;));&#10;scrollView.Add(new Label(&quot;내용 3&quot;));&#10;&#10;// 스크롤 모드 설정&#10;var verticalScroll = new UTKScrollView(ScrollViewMode.Vertical);&#10;var horizontalScroll = new UTKScrollView(ScrollViewMode.Horizontal);" />
<utk:UTKCodeBlock title="UXML" code="&lt;!-- 기본 스크롤 뷰 --&gt;&#10;&lt;utk:UTKScrollView style=&quot;height: 200px;&quot;&gt;&#10; &lt;Label text=&quot;항목 1&quot; /&gt;&#10; &lt;Label text=&quot;항목 2&quot; /&gt;&#10; &lt;Label text=&quot;항목 3&quot; /&gt;&#10;&lt;/utk:UTKScrollView&gt;&#10;&#10;&lt;!-- 수직 스크롤만 --&gt;&#10;&lt;utk:UTKScrollView mode=&quot;Vertical&quot; /&gt;&#10;&#10;&lt;!-- 수평 스크롤만 --&gt;&#10;&lt;utk:UTKScrollView mode=&quot;Horizontal&quot; /&gt;" />
</VisualElement>
2026-01-20 20:18:47 +09:00
</VisualElement>
</UXML>