We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add
replace
我有個疑問, 如果將add 修改成replace, 會是比較好的選擇嗎? 為什麼?
The text was updated successfully, but these errors were encountered:
replace 的本质是 remove 已经 add 的 fragment,然后 add 新的 fragment。如果是第一个 fragment 的话,replace 和 add 最后的效果一样,但 replace 会走更多的逻辑判断。
第二个 fragment 以及之后加入的 fragment 应该用 replace,因为这样可以释放 View, 代码可见 BaseFragmentActivity.startFragment
Sorry, something went wrong.
No branches or pull requests
具体问题描述
add
replace
我有個疑問, 如果將add 修改成replace, 會是比較好的選擇嗎? 為什麼?
The text was updated successfully, but these errors were encountered: