Appcelerator 隐藏具有相同 class (Alloy) 的多个视图

Appcelerator hide multiple view with same class (Alloy)

我正在寻找一种方法 show/hide 具有相同 class 的多个视图。 使用 jQuery 可以执行此操作:

$('.className').hide();

有什么方法可以在 appcelerator JS 中做到这一点?谢谢。

我不这么认为。您必须遍历视图数组并在每个视图数组上调用 hide()。

如果可以将所有视图添加到同一父视图,则可以只隐藏父视图。

不,你不能那样做,你可以Dynamic Styleshttp://docs.appcelerator.com/platform/latest/#!/guide/Dynamic_Styles

    $.addClass($.view, "hide"); // --> appears blue and 24dp

tss

".hide" : {
    visible: false
}