Xamarin表单编辑器LineBreakMode

问题描述 投票:0回答:1

编辑器控件没有LineBreakMode属性,例如Labels。我想完成与在NotePad上禁用自动换行相同的行为,其中行不换行,并且自动显示水平滑块。

有什么想法使编辑器不换行吗?

标签示例:

<Label Text="Welcome to Xamarin Forms!" LineBreakMode="NoWrap"/>
c# .net xamarin xamarin.forms
1个回答
0
投票

Editor控件用于接受多行输入。对于单行条目,可以使用Entry

[Entryhttps://docs.microsoft.com/en-us/dotnet/api/xamarin.forms.entry?view=xamarin-forms

如果您想不带文本使用Editor,则可以将Editor放在StackLayout中,并将Orientation属性设置为Horizontal

<StackLayout Orientation="Horizontal">
            <Editor Placeholder="Once upon a time far far away there lived a bear. The bear lived in the woods all on his own." />
        </StackLayout>

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.