首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Maui编辑器元素行为

Maui编辑器元素行为
EN

Stack Overflow用户
提问于 2022-07-10 10:48:23
回答 1查看 238关注 0票数 0

我试图实现一个编辑器,它不会成功地包装文本,我希望通过按enter而不是通过包装文本来实现换行符

我怎么能得到它?

我试过这个:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MauiApp1.MainPage">
             
    <ScrollView>
        <VerticalStackLayout 
            Spacing="25" 
            Margin="5" 
            VerticalOptions="Center" >

            <Border Stroke= "Black" StrokeThickness="2" Background="Pink" >
                <Editor HeightRequest="300" WidthRequest="380" BackgroundColor="Aqua" />
            </Border>    
            
            <Image
                Source="dotnet_bot.png"
                SemanticProperties.Description="Cute dot net bot waving hi to you!"
                HeightRequest="200"
                HorizontalOptions="Center" />
                
            <Label 
                Text="Hello, World!"
                SemanticProperties.HeadingLevel="Level1"
                FontSize="32"
                HorizontalOptions="Center" />
            
            <Label 
                Text="Welcome to .NET Multi-platform App UI"
                SemanticProperties.HeadingLevel="Level2"
                SemanticProperties.Description="Welcome to dot net Multi platform App U I"
                FontSize="18"
                HorizontalOptions="Center" />

            <Button 
                x:Name="CounterBtn"
                Text="Click me"
                SemanticProperties.Hint="Counts the number of times you click"
                Clicked="OnCounterClicked"
                HorizontalOptions="Center" />

        </VerticalStackLayout>
    </ScrollView>
 
</ContentPage>

非常感谢

EN

回答 1

Stack Overflow用户

发布于 2022-07-11 07:08:46

您可以使用嵌套的ScrollView

Xaml:

代码语言:javascript
复制
   <ScrollView>
    <VerticalStackLayout 
        Spacing="25" 
        Margin="5" 
        VerticalOptions="Center" >
        
        <Border Stroke= "Black" StrokeThickness="2" Background="Pink" >
            <ScrollView Orientation="Both" HeightRequest="300" WidthRequest="380" >
                <Editor BackgroundColor="Aqua" TextChanged="Editor_TextChanged"   />
            </ScrollView> 
          
        </Border>


       .............

    </VerticalStackLayout>
</ScrollView>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72927900

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档