如果主动关闭 视图调试窗口,应该释放对视图树的引用

Open
#375 0 comments 0 reactions 1 assignee View on GitHub

@AdamCaoQAQ is already working on this.

Since Mar 23, 2022.

Assessment

This issue has not been assessed yet.

Description

bug Platform: tenon

AnimationEntry1 子视图的释放在控制台不能输出

描述

Hummer version:

复现步骤

预期结果

class AnimationEntry1 extends View {
    view: View;
    constructor() {
        super();
        this.style = {
            width: 200,
            height: 200,
            backgroundColor: '#aa0044'
        };
        this.view = new View();
        this.view.style = {
            width: 100,
            height: 100,
            backgroundColor: '#00FF00'
        }
        this.appendChild(this.view);
    }
}

class RootView extends View {
    listViews:Array<AnimationEntry1> = new Array<AnimationEntry1>()

    constructor() {
        super();
        this.style = {
            width: '100%',
            height: '100%',
            backgroundColor: "#FF0000",
        }
        for (let index = 0; index <3; index++) {
            const element = new AnimationEntry1();
            this.listViews.push(element);
            this.appendChild(element);
        }
        this.addEventListener('tap', ()=> {
           while(this.listViews.length > 0) {
            this.listViews.pop();
           }
           this.removeAll();
           console.log("AnimationEntry 点击了");
        });
    }
}
Hummer.render(new RootView());
Dominant language
Objective-C
Stars
1.4k
Forks
186
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from didi/Hummer

All issues in didi/Hummer

Similar issues

More Objective-C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.