gpt4 book ai didi

android - Surface 在 Android 应用程序上无效

转载 作者:行者123 更新时间:2023-11-30 02:35:31 25 4
gpt4 key购买 nike

您好 appcelerator 专家,

我目前正在编写一个带有 3 个窗口(合金)的简单应用程序。按下按钮时,窗口会依次出现,因此窗口 1 会显示一个按钮 -> 转到窗口 2 -> 按其按钮 -> 窗口 3。使用后退按钮可以返回到之前的窗口。

问题是应用程序在窗口之间切换时有时会崩溃并重新启动并产生错误“ViewRootImpl #2 Surface is not valid”,我不知道如何解决。任何人以前见过这个问题或猜测可能是什么问题?也许 eventListeners 经常被删除?

应用类型:手机钛 SDK:3.4.0.GA平台及版本:Android 4.1设备:物理安卓设备主机操作系统:Mac OSX Yosemite钛工作室:3.4.0.201409261227 构建:jenkins-titanium-rcp-master-197

View (index.xml):

<Alloy>


<Window id="intro_android" class="container">
<View id="vdescription">
<Label id="description1">Do you like discovering new restaurants, eating nice food AND saving money?</Label>
<Label id="description2">The Food Fairy will help you!</Label>
<Label id="description3">You will receive notifications like this:</Label>
<ImageView id="screenshot" image="/images/screenshot.png"></ImageView>
</View>
<View class="vbutton">
<Button id="getstarted" ></Button>
</View>
</Window>

<Window id="usage_android" class="container">
<View id="vsaved">
<Label id="text_saved">You currently saved:</Label>
<Label id="amount_saved">00.00 €</Label>
</View>
<View id="vranking">
<TableView id="table">
<TableViewSection>
<TableViewRow class="row1"><Label class="number_ranking">1.</Label><Label class="name_ranking">John</Label><Label class="amount_ranking">637.02 €</Label></TableViewRow>
<TableViewRow class="row2"><Label class="dots_ranking">...</Label></TableViewRow>
<TableViewRow class="row3"><Label class="number_ranking">524.</Label><Label class="name_ranking">Mary</Label><Label class="amount_ranking">00.81 €</Label></TableViewRow>
<TableViewRow class="userrow_ranking"><Label id="usernumber_ranking">525.</Label><Label id="username_ranking">YOU</Label><Label id="useramount_ranking">00.00 €</Label></TableViewRow>
<TableViewRow class="row4"><Label class="number_ranking">526.</Label><Label class="name_ranking">Sarah</Label><Label class="amount_ranking">00.00 €</Label></TableViewRow>
<TableViewRow class="row5"><Label class="dots_ranking">...</Label></TableViewRow>
</TableViewSection>
</TableView>
</View>
<View class="vbutton">
<Button id="gethelp" ></Button>
</View>
</Window>

<Window id="help" class="container">
<ScrollView id="vhelp">
<Label id="help_text1">Heres more information:</Label>
<Label class="help_text2">The Food Fairy finds the best food deals close to you! To help you find a place close-by to grab a bite on a budget, the fairy will send you a notification when you approach a restaurant offering a special deal.</Label>
<Label class="help_text2">Because shes magic (duh), she doest need your app to be open and doesnt use GPS; she will know where you are, where the deals are, and will let you know when your paths cross.</Label>
</ScrollView>
</Window>

</Alloy>

Controller (index.js):

function start_android(e) {
$.usage_android.open();
}

function start_ios(e) {
$.usage_ios.open();
}

function start_help(e) {
$.help.open();
}

感谢您的帮助!

最佳答案

对于任何有类似问题的人,我已经通过将按钮移到他们的 View 之外解决了这个问题:

<View class="vbutton">
<Button id="getstarted" ></Button>
</View>

进入:

    <Button id="getstarted" ></Button>  

关于android - Surface 在 Android 应用程序上无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26627060/

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