0

我有一个现有的项目超过半年没有开发。 现在我需要支持它。 我已经更新了Titanium SDK和项目中使用的所有其他库。 但在设备上启动应用程序后,我有运行时错误。错误的 的截图:加速器钛运行时错误

enter image description here

我很惊讶,因为这是应用程序的准备生产的稳定版本。所以只有在更新库之后才会出现此错误。 下面的代码的某些部分:

这是 '索引' 视图:

<?xml version="1.0"?> 
<Alloy> 
<Widget id="drawer" src="nl.fokkezb.drawer"> 
    <Window module="xp.ui" role="leftWindow" > 
     ...... 
    </Window> 
    <NavigationWindow platform="ios" role="centerWindow"> 
     <Require type="view" src="Home"/> 
    </NavigationWindow> 
    <Window module="xp.ui" platform="android" role="centerWindow" home="Home"> 
     <Require type="view" src="Home"/> 
    </Window> 
</Widget> 
</Alloy> 

和HOME.xml

<Alloy> 
<Window id="winHome" platform="ios" class="container whiteBackground no-navbar" navBarHidden="true" layout="vertical" opacity="1"> 
    <Require type="view" src="homeContent"></Require> 
</Window> 
<Window id="winHome" platform="android" class="container whiteBackground no-navbar" navBarHidden="true" layout="vertical" opacity="1"> 
    <Require type="view" src="homeContent"></Require> 
</Window> 
</Alloy> 

和homeContent:

<Alloy> 
<View id="winHomeContent" class="container whiteBackground" layout="composite" visible = "false"> 
    <View class="ver"> 
     ......... 
    </View> 
    <View bottom="0" class="h-size"> 
     <Require type="view" src="homeFooter"/> 
    </View> 
</View> 
</Alloy> 

我见“索引”和主页视图都有“窗口”标签。 但是这个确切的代码工作得更早。

+0

你截图的网址需要许可! –

+0

对不起,现在应该是固定的 –

+0

我把它添加到帖子,而不是 –

回答

1

index.xml从文件nl.fokkezb.drawer

centerWindow角色是View不是Window

<Alloy> 
    <Widget id="drawer" src="nl.fokkezb.drawer"> 

     <Window module="xp.ui" role="leftWindow"> 
      <Label>I am left</Label> 
     </Window> 

     <NavigationWindow platform="ios" role="centerWindow"> 
      <Window> 
       <LeftNavButton> 
        <Button onClick="toggle">Left</Button> 
       </LeftNavButton> 
       <Label>I am center</Label> 
       <RightNavButton> 
        <Button onClick="toggle">Right</Button> 
       </RightNavButton> 
      </Window> 
     </NavigationWindow> 
     <View platform="android" role="centerWindow"> 
      <Label>I am center</Label> 
     </View> 

     <Window module="xp.ui" role="rightWindow"> 
      <Label>I am right</Label> 
     </Window> 

    </Widget> 
</Alloy> 
+0

我试过了,现在我有其他错误: 'TextView:stopSelectionActionMode()' 我有这条线多次,然后应用程序失败 –

+0

可以发布控制台日志?因为这是另一个问题 –

+0

[这里](https://docs.google.com/document/d/1UfXZO1u_50Vu8JnYrlxxGGIP01sklXT-Rlm2JCCw4Os/edit?usp=sharing)是链接完成日志文件 –

0

module="xp.ui"index转换为Window转换为View。在你的Home.xml你有两个平台的1 Window,但代码是一样的!所以,在你Home.xmlView这样的替换Window

<View id="winHome" platform="android" class="container whiteBackground no-navbar" navBarHidden="true" layout="vertical" opacity="1"> 
    <Require type="view" src="homeContent"></Require> 
</View> 

你的问题是两个平台上? iOS? Android? 顺便说一句,你的截图不公开,所以我们看不到它。

+0

我修正了截图。 问题是android特定的。 –