다음을 통해 공유


Windows의 InputView 읽기 순서

이 .NET 다중 플랫폼 앱 UI(.NET MAUI) Windows 플랫폼별을 사용하면 양방향 텍스트의 읽기 순서(왼쪽에서 오른쪽 또는 오른쪽에서 EntryEditor왼쪽으로) 및 Label 개체를 동적으로 검색할 수 있습니다. XAML에서는 (for EntryEditor objects) 또는 Label.DetectReadingOrderFromContent 연결된 속성을 값으로 boolean 설정 InputView.DetectReadingOrderFromContent 하여 사용합니다.

<ContentPage ...
             xmlns:windows="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;assembly=Microsoft.Maui.Controls">
    <StackLayout>
        <Editor ... windows:InputView.DetectReadingOrderFromContent="true" />
        ...
    </StackLayout>
</ContentPage>

또는 흐름 API를 사용하여 C#에서 사용할 수 있습니다.

using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
...

editor.On<Microsoft.Maui.Controls.PlatformConfiguration.Windows>().SetDetectReadingOrderFromContent(true);

이 메서드는 Editor.On<Microsoft.Maui.Controls.PlatformConfiguration.Windows> 이 플랫폼별이 Windows에서만 실행되도록 지정합니다. 이 메서드는 InputView.SetDetectReadingOrderFromContent 네임스페이 Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific 스의 콘텐츠 InputView에서 읽기 순서가 검색되는지 여부를 제어하는 데 사용됩니다. 또한 메서드를 InputView.SetDetectReadingOrderFromContent 사용하여 현재 값을 반환하도록 메서드를 호출 InputView.GetDetectReadingOrderFromContent 하여 콘텐츠에서 읽기 순서가 검색되는지 여부를 전환할 수 있습니다.

editor.On<Microsoft.Maui.Controls.PlatformConfiguration.Windows>().SetDetectReadingOrderFromContent(!editor.On<Microsoft.Maui.Controls.PlatformConfiguration.Windows>().GetDetectReadingOrderFromContent());

그 결과 Entry개체 EditorLabel 는 콘텐츠의 읽기 순서를 동적으로 검색할 수 있습니다.

InputView detecting reading order from content platform-specific.

참고 항목

속성을 설정하는 FlowDirection 것과 달리 텍스트 콘텐츠에서 읽기 순서를 검색하는 뷰의 논리는 보기 내의 텍스트 맞춤에 영향을 미치지 않습니다. 대신 양방향 텍스트 블록이 배치되는 순서를 조정합니다.