首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >增加栅格大小

增加栅格大小
EN

Stack Overflow用户
提问于 2020-10-12 03:29:33
回答 1查看 91关注 0票数 0

我正在设计一个登录界面,这是我的xaml

我不能增加网格大小的背景红色,因为我放了很多“入口”,但这些消失了,如果你知道任何属性,请给我你的建议

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8" ?>

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
     
<ContentPage.Content>
    <yummy:PancakeView
    BackgroundGradientStartPoint="0,1"
    BackgroundGradientEndPoint="1,0"
    Margin="0,0,0,10"        
    HorizontalOptions="FillAndExpand"      
    CornerRadius="0,0,400,0">
        <yummy:PancakeView.BackgroundGradientStops>
            <yummy:GradientStopCollection>
                <yummy:GradientStop Color="#155cab" Offset="0" />
                <yummy:GradientStop Color="#155cab" Offset="0.5" />
            </yummy:GradientStopCollection>
        </yummy:PancakeView.BackgroundGradientStops>
        <StackLayout>
            <yummy:PancakeView
            BackgroundGradientStartPoint="0,1"
            BackgroundGradientEndPoint="1,0"
            HeightRequest="240"
            WidthRequest="320"
            Padding="0,0,100,500"         
            HorizontalOptions="End"      
            CornerRadius="0,0,500,0">
                <yummy:PancakeView.BackgroundGradientStops>
                    <yummy:GradientStopCollection>
                        <yummy:GradientStop Color="#155cab" Offset="0" />
                        <yummy:GradientStop Color="#1C75D8" Offset="0.5" />
                        <yummy:GradientStop Color="#589ce7" Offset="1" />
                    </yummy:GradientStopCollection>
                </yummy:PancakeView.BackgroundGradientStops>
                <Grid BackgroundColor="red"  Margin="100,0,0,0" VerticalOptions="StartAndExpand">
                    <Grid.RowDefinitions>
                        <RowDefinition  Height="Auto"    />
                        <RowDefinition  Height="*"    />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>

                    <Image                               
                            Grid.Row="0"
                            WidthRequest="100"
                            HeightRequest="100"
                            Source="UserLogin.png"
                            Margin="0,50,0,50"
                    />

                    <StackLayout Grid.Row="1" BackgroundColor="Orange">
                        <Entry Placeholder="hello"/>
                        <Entry  Placeholder="hello 1"/>
                        <Entry  Placeholder="hello 2"/>
                        <Entry  Placeholder="hello 3"/>
                        <Entry  Placeholder="hello 4"/>
                        
                    </StackLayout>
                </Grid>          
            </yummy:PancakeView>
        </StackLayout>
    </yummy:PancakeView>
</ContentPage.Content>

我将显示图像(xaml文件)。请帮帮我

enter image description here

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-10-13 11:09:36

您在第二个yummy:PancakeView中将底部填充设置为500太大了。我使用以下布局将其设置为0,它起作用了。

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:yummy="clr-namespace:Xamarin.Forms.PancakeView;assembly=Xamarin.Forms.PancakeView"
             x:Class="PanCakeView.MainPage">

    <ContentPage.Content>
        <yummy:PancakeView
    BackgroundGradientStartPoint="0,1"
    BackgroundGradientEndPoint="1,0"
    Margin="0,0,0,10"        
    HorizontalOptions="FillAndExpand"      
            
    CornerRadius="0,0,400,0">
            <yummy:PancakeView.BackgroundGradientStops>
                <yummy:GradientStopCollection>
                    <yummy:GradientStop Color="#155cab" Offset="0" />
                    <yummy:GradientStop Color="#155cab" Offset="0.5" />
                </yummy:GradientStopCollection>
            </yummy:PancakeView.BackgroundGradientStops>
            <StackLayout>
                <yummy:PancakeView
            BackgroundGradientStartPoint="0,1"
            BackgroundGradientEndPoint="1,0"
            HeightRequest="800"
            WidthRequest="320"
            Padding="0,0,100,0"         
            HorizontalOptions="End"      
            CornerRadius="0,0,500,0">
                    <yummy:PancakeView.BackgroundGradientStops>
                        <yummy:GradientStopCollection>
                            <yummy:GradientStop Color="#155cab" Offset="0" />
                            <yummy:GradientStop Color="#1C75D8" Offset="0.5" />
                            <yummy:GradientStop Color="#589ce7" Offset="1" />
                        </yummy:GradientStopCollection>
                    </yummy:PancakeView.BackgroundGradientStops>


                    <Grid BackgroundColor="red"  Margin="100,0,0,0"  VerticalOptions="StartAndExpand">
                        <Grid.RowDefinitions>
                            <RowDefinition  Height="Auto"    />
                            <RowDefinition  Height="*"    />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <Image                               
                            Grid.Row="0"
                            WidthRequest="100"
                            HeightRequest="100"
                            Source="UserLogin.png"
                            Margin="0,50,0,50"
                    />

                        <StackLayout Grid.Row="1" BackgroundColor="Orange">
                            <Entry Placeholder="hello"/>
                            <Entry  Placeholder="hello 1"/>
                            <Entry  Placeholder="hello 2"/>
                            <Entry  Placeholder="hello 3"/>
                            <Entry  Placeholder="hello 4"/>

                        </StackLayout>
                    </Grid>

                </yummy:PancakeView>
            </StackLayout>
        </yummy:PancakeView>
    </ContentPage.Content>

</ContentPage>

这是运行截图。

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

https://stackoverflow.com/questions/64308177

复制
相关文章

相似问题

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