修复隐藏加号按钮关闭后的底栏布局无法恢复五等分的问题#313
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复开启“隐藏底栏加号”后,再关闭该设置时,底栏布局没有正确恢复的问题。
此前隐藏加号时,逻辑会直接让加号按钮的工厂方法返回
nil,导致加号按钮不再创建。随后底栏在layoutSubviews中会按照当前存在的 4 个按钮重新均分宽度,因此“首页、朋友、消息、我”会保持四等分布局。关闭隐藏设置后,加号虽然恢复显示逻辑,但原本缺失的视图和已经被改写的 frame 无法稳定恢复,最终造成加号位置异常。本次修复改为保留加号按钮的创建流程,只在
AWENormalModeTabBar布局阶段根据DYYYHidePlusButton控制加号的隐藏与显示。同时将加号按钮纳入底栏按钮识别和背景跳过逻辑,确保开启隐藏时为 4 等分,关闭隐藏后可恢复为 5 等分布局。纯AI修复