QMUIAlertController Alert样式Actions 布局错误 #1666
Closed
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.
期望
QMUIAlertController能够完全按照添加顺序布局按钮。虽然提供了
orderActionsByAddedOrdered属性,但仍然存在以下问题:QMUIAlertActionStyleCancel)始终会被放置在最后,这与期望的完全按添加顺序布局不符。而
Alert按钮的文本样式可以通过全局的alertButtonAttributes、alertDestructiveButtonAttributes和alertCancelButtonAttributes进行配置。但产品需求经常变化,有时要求取消按钮在左侧,有时又要求在右侧,缺乏灵活性。
如果
QMUIAlertController可以完全按照添加顺序布局按钮,开发者只需选择合适的QMUIAlertActionStyle并控制添加顺序,即可灵活满足各种布局需求,无需进行额外的全局样式调整。 这样可以大大提高开发效率和布局的灵活性。