簡體   English   中英

在view.xml Appcelerator Titanium中使用if

[英]Using if in view.xml Appcelerator Titanium

<ListSection sec="fav" if="Alloy.CFG.favourite.enabled === true">
        <ListItem myTitle:text="L('fav')" slug="newsrizeFav" template="regularItem" />
</ListSection>

我正在使用if的鈦合金中的view.xml屬性在android上完美運行,但在IOS上,如果Alloy.CFG.favourite.enabled = true沒問題,但是如果Alloy.CFG.favourite.enabled = false鈦拋出異常

"Error: Invalid type passed to function"

我剛剛對Alloy 1.8.5進行了編譯,結果是:

if (true === Alloy.CFG.favourite.enabled) {
    $.__views.__alloyId67 = Ti.UI.createListSection({
        id: "__alloyId67"
    });
}

在iOS和Android上都應該可以正常工作。 我認為該錯誤源自相關的內容,而不是此特定屬性本身。 異常不會列出實際的行號,以便您可以調試(使用/Resources的生成代碼)嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM