【发布时间】:2018-10-28 14:49:15
【问题描述】:
我对@987654323@ 很陌生。我正在关注它自己的文件。我正在尝试 UI 对齐。我无法做到这一点。我正在使用Xcode IDE 并在iOS Simulator 中运行。
杂货标志应该在顶部
文本字段应该在中间
注册按钮应该在底部
尝试 1
<Page loaded="loaded">
<GridLayout height=auto horizontalAlignment="center" verticalAlignment="center" columns="*" rows="auto,auto,*" backgroundColor="brown">
<Image src="res://logo" stretch="aspectFit" horizontalAlignment="center" verticalAlignment="top" col="0" row="0"></Image>
<GridLayout columns="*" rows="auto,auto,auto" verticalAlignment="center" backgroundColor="lightgray" col="0" row="1">
<TextField class="userTxtFld" id="email" text="{{ email }}" hint="Email Address" keyboardType="email" autocorrect="false" autocapitalizationType="none" col="0" row="0"/>
<TextField secure="true" text="{{ password }}" hint="Password" col="0" row="1"/>
<Button text="Sign in" tap="signIn" col="0" row="2"/>
</GridLayout>
<Button text="Sign up for Groceries" class="link" tap="register" verticalAlignment="bottom" col="0" row="2"/>
</GridLayout>
</Page>
尝试 2
<Page loaded="loaded">
<GridLayout height="auto" horizontalAlignment="center" verticalAlignment="center" columns="*" rows="auto,auto,*" backgroundColor="brown">
<Image src="res://logo" stretch="aspectFit" horizontalAlignment="center" verticalAlignment="top" col="0" row="0"></Image>
<GridLayout columns="*" rows="auto,auto,auto" verticalAlignment="center" backgroundColor="lightgray" col="0" row="1">
<TextField class="userTxtFld" id="email" text="{{ email }}" hint="Email Address" keyboardType="email" autocorrect="false" autocapitalizationType="none" col="0" row="0"/>
<TextField secure="true" text="{{ password }}" hint="Password" col="0" row="1"/>
<Button text="Sign in" tap="signIn" col="0" row="2"/>
</GridLayout>
<Button text="Sign up for Groceries" class="link" tap="register" verticalAlignment="bottom" col="0" row="2"/>
</GridLayout>
</Page>
问题
在尝试 1 中,height=auto,在尝试 2 中,height="auto"
我需要作为尝试 1 的输出。
我不知道,为什么 backgroundcolor 没有显示在 height=auto
我不知道,为什么 UI Alignment 没有在 height="auto"
如果 height="auto" 是正确的方法,如何将输出作为尝试 1?
请帮帮我。
输出
【问题讨论】:
标签: xml nativescript grid-layout nativescript-telerik-ui