gpt4 book ai didi

javascript - 单击文本框 appcelerator 时可滚动的表单 View

转载 作者:行者123 更新时间:2023-12-03 08:15:38 24 4
gpt4 key购买 nike

我在index.xml文件中有这个,其中窗口有3个 View ,其中第二个 View 是带有2个文本框的表单 View 。点击文本框后,它会隐藏在虚拟键盘后面。我想在输入文本框时获得可 ScrollView 。

在index.js中,我将窗口打开为$.win.open()和$.win1.open()。

<Alloy>
<View id="network" class="network" width= Titanium.UI.FILL visible="false" top="30">
<Label class="networkLabel">Oops! No Internet Connection. Please retry again later</Label>
</View>
<NavigationWindow id="win1" platform="ios" zIndex= 1 >
<Window id="win" class="container" title="Login">
<View id="specificError" class="network" width= Titanium.UI.FILL visible="false" top="50">
<Label class="networkLabel">Oops! Something went wrong. We're on it.</Label>
</View>
<View class="headingView">
<ImageView id="iconImage" image="images/xx.png" opacity="0.8" />
<Label id="headingLabel">xxx</Label>
<Label class="subheadLabel">xxxxxxx</Label>
</View>

<View class="formView">
<TextField id="xx" height="50" value="xx">
<ImageView id="iconEmailImage" image="images/iOS_Login_Email_Icon.png" />
</TextField>
<View id="borderBottom"></View>

<TextField passwordMask="true" id="password" height="50" value="xxx">
<ImageView id="iconPwdImage" image="images/iOS_Login_Pwd_Icon.png" />
</TextField>
<View id="borderBottom"></View>

<Button id="btnLogin" title="LOGIN" height="50" color="#ffffff" backgroundColor="#8EBECC" textAlign="Titanium.UI.TEXT_ALIGNMENT_CENTER" onClick="doLogin"></Button>

</View>

<View class="footerView">
<ImageView id="XX" image="images/XX.png"></ImageView>
<Label class="copyrightLabel">copyright(c) 2015 xxx Co.All rights reserved. </Label>
</View>
</Window>

</NavigationWindow>

最佳答案

实现此目的的最简单方法是在窗口中添加 ScrollView。添加 top、bottom 和 contentHeight 属性,如下例所示。通常,我通过 TSS 或 ScrollView 上的类属性(也在 tss 文件中声明)来执行此操作。

<Alloy>
<NavigationWindow id="win1" platform="ios" zIndex="1">
<Window id="win" class="container" title="Login">
<ScrollView top="0" bottom="0" contentHeight="Ti.UI.SIZE">
<!-- Your window child view elements -->
</ScrollView>
</Window>
</NavigationWindow>
</Alloy>

关于javascript - 单击文本框 appcelerator 时可滚动的表单 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33961680/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com