📜  kotlin 启用和禁用父视图子视图 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:16.158000             🧑  作者: Mango

代码示例1
private static void setViewAndChildrenEnabled(View view, boolean enabled) {
    view.setEnabled(enabled);
    if (view instanceof ViewGroup) {
        ViewGroup viewGroup = (ViewGroup) view;
        for (int i = 0; i < viewGroup.getChildCount(); i++) {
            View child = viewGroup.getChildAt(i);
            setViewAndChildrenEnabled(child, enabled);
        }
    }
}