【发布时间】:2021-08-11 00:31:39
【问题描述】:
当占位符太长而无法放入 StackLayout 时,我的 Xamarin.forms 应用程序中的 XAML 编辑器没有包装占位符。但是,我真的很想使用编辑器,因为它可以进行多行输入和文本。请让我知道如何实现这一目标。下面是我的 XAML 代码。
<ScrollView>
<StackLayout>
<Frame BorderColor="LightGray" HasShadow="False" Padding="0">
<Editor x:Name="Editor" MaxLength="450" HeightRequest="200" Placeholder="Long placeholder text, the text should wrap but it doesn't. It just keeps going on and not being visible on the screen"></Editor>
</Frame>
</StackLayout>
</ScrollView>
下面是我尝试将占位符文本设置为以下结果的图像:“这是非常长的占位符文本 lorem ipsum dolor sit amet hi hi hi hi”
【问题讨论】:
-
我测试了你的代码行,它正在包装,我们可能需要更多上下文
-
嗯,我补充说它现在在滚动视图和堆栈布局中。滚动视图可能是原因吗?
-
没有。我用滚动视图测试,它正在包装。检查屏幕截图。 imgur.com/GPBkMhq
标签: xaml xamarin.forms