Xamarin形式:RowDefinition height OnIdiom属性的正确格式是什么?

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

我在网格内有2行,因为第一行的大小固定。我正在尝试在此处应用OnIdiom功能。尝试如下:

<Grid.RowDefinitions>
    <RowDefinition>
        <RowDefinition.Height>
            <OnIdiom x:TypeArguments="x:Double">
                <OnIdiom.Phone>30</OnIdiom.Phone>
                <OnIdiom.Tablet>60</OnIdiom.Tablet>
            </OnIdiom>
        </RowDefinition.Height>
    </RowDefinition>
    <RowDefinition Height="auto"/>
</Grid.RowDefinitions>

但是在错误列表上出现以下错误:

No property, bindable property, or event found for 'Height', or mismatching type between value and property.

RowDefinition height OnIdiom属性的正确格式是什么?

xamarin.forms grid rowdefinition
2个回答
1
投票
您可以使用OnIdiom标记扩展名:

0
投票
<RowDefinition Height="{OnIdiom Phone=30, Tablet=60}"/>
© www.soinside.com 2019 - 2024. All rights reserved.