보기 데이터 지속성은 UI의 시각적 요소와 연결된 보기 데이터를 보존합니다.보기 데이터는 UI의 기본 데이터 모델에 포함되지 않은 사용자 인터페이스의 상태를 참조합니다.예를 들어 보기 데이터에는 스크롤 바의 스크롤 위치나 리스트의 선택 항목이 포함될 수 있습니다.
보기 데이터 지속성은 에디터에서 특정 이벤트 발생 중에 보존되지 않는 UI 보기 데이터 문제를 해결합니다.
참고:보기 데이터 지속성은 에디터 UI에서만 작동됩니다.
지원되는 요소에 대해 보기 데이터 지속성을 활성화하려면 보기 데이터 키를 에디터 창(EditorWindow
타입) 내 고유 스트링으로 설정하십시오.이는 UI 빌더, UXML, C#에서 설정할 수 있습니다.
view-data-key
속성으로 키를 설정합니다.viewDataKey
프로퍼티로 키를 설정합니다.다음 요소는 현재 보기 데이터 지속성을 지원합니다.
보기 데이터 지속성을 활성화하면 이러한 요소가 내부 보기 상태를 기억합니다.
읽기 전용 요소에 대한 보기 데이터 지속성을 활성화하려면 부모 요소에서 보기 데이터 키를 설정합니다.
예를 들어 ScrollView에는 여러 개의 읽기 전용 Scroller 자식 요소가 있습니다.각 Scroller에는 ScrollView 요소 내에서 고유한 보기 데이터 키가 주어집니다.Foldout에 대한 보기 데이터 키를 설정한 경우 Foldout에 해당 보기 데이터가 유지됩니다.Scroller에 키가 있어도 보기 데이터는 유지되지 않습니다.지속성을 활성화하려면 부모 ScrollView에 대한 보기 데이터 키를 설정해야 합니다.Scroller는 보기 데이터 키를 부모의 보기 데이터 키와 결합하여 고유한 전역 보기 데이터 키를 생성합니다.
참고:현재 보기 데이터 지속성에 대한 지원을 추가하는 데 필요한 API는 내부에 있으므로 커스텀 컨트롤에 대해 보기 데이터 지속성을 활성화할 수 없습니다.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.