1. <small id='Jewu3'></small><noframes id='Jewu3'>

        <legend id='Jewu3'><style id='Jewu3'><dir id='Jewu3'><q id='Jewu3'></q></dir></style></legend>
      2. <tfoot id='Jewu3'></tfoot>
          <bdo id='Jewu3'></bdo><ul id='Jewu3'></ul>
      3. <i id='Jewu3'><tr id='Jewu3'><dt id='Jewu3'><q id='Jewu3'><span id='Jewu3'><b id='Jewu3'><form id='Jewu3'><ins id='Jewu3'></ins><ul id='Jewu3'></ul><sub id='Jewu3'></sub></form><legend id='Jewu3'></legend><bdo id='Jewu3'><pre id='Jewu3'><center id='Jewu3'></center></pre></bdo></b><th id='Jewu3'></th></span></q></dt></tr></i><div id='Jewu3'><tfoot id='Jewu3'></tfoot><dl id='Jewu3'><fieldset id='Jewu3'></fieldset></dl></div>
      4. Stackview 交换或更改视图顺序

        时间:2023-09-10
        <tfoot id='BUqZ2'></tfoot>
        <legend id='BUqZ2'><style id='BUqZ2'><dir id='BUqZ2'><q id='BUqZ2'></q></dir></style></legend>
          <tbody id='BUqZ2'></tbody>

            1. <i id='BUqZ2'><tr id='BUqZ2'><dt id='BUqZ2'><q id='BUqZ2'><span id='BUqZ2'><b id='BUqZ2'><form id='BUqZ2'><ins id='BUqZ2'></ins><ul id='BUqZ2'></ul><sub id='BUqZ2'></sub></form><legend id='BUqZ2'></legend><bdo id='BUqZ2'><pre id='BUqZ2'><center id='BUqZ2'></center></pre></bdo></b><th id='BUqZ2'></th></span></q></dt></tr></i><div id='BUqZ2'><tfoot id='BUqZ2'></tfoot><dl id='BUqZ2'><fieldset id='BUqZ2'></fieldset></dl></div>

              <small id='BUqZ2'></small><noframes id='BUqZ2'>

              • <bdo id='BUqZ2'></bdo><ul id='BUqZ2'></ul>

                  本文介绍了Stackview 交换或更改视图顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  包含文本字段数组的 Stackview 嵌入在滚动视图中.我想更改某些操作的文本字段的顺序.删除和添加文本字段的方式会导致视图失真.我还通过从滚动视图中删除进行了测试.正常的 stackview 也没有正确显示交换.我正在使用索引进行更改:

                  Stackview containing array of textfield is embedded in scrollview. I want to change the order of the text fields on some actions. The way to remove and add the textfield results in distorted view. I also tested by removing from scrollview. Normal stackview too the exchange does not appear properly. I am using indexes to change :

                  stackView.removeArrangedSubview(localityTF)stackView.insertArrangedSubview(localityTF, at: 2)

                  推荐答案

                  这是一个奇怪的行为,但是自动布局系统有问题,应该在添加 localityTF 之前更新.另外不要忘记 removeArrangedSubview 不会从 subviews 数组中删除视图:

                  It is strange behaviour, but problem with the autolayout system, that should be updated before you can add localityTF back. Also don't forget that removeArrangedSubview does not remove the view from subviews array:

                  [self.stackView removeArrangedSubview:_label1];
                  [self.stackView setNeedsLayout];
                  [self.stackView layoutIfNeeded];
                  
                  [self.stackView insertArrangedSubview:_label1 atIndex:2];   
                  [self.stackView setNeedsLayout];
                  

                  这篇关于Stackview 交换或更改视图顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 Swift 动画视图高度 下一篇:如何在 Xcode 游乐场中使用自动布局约束显示视图?

                  相关文章

                1. <i id='tSRMK'><tr id='tSRMK'><dt id='tSRMK'><q id='tSRMK'><span id='tSRMK'><b id='tSRMK'><form id='tSRMK'><ins id='tSRMK'></ins><ul id='tSRMK'></ul><sub id='tSRMK'></sub></form><legend id='tSRMK'></legend><bdo id='tSRMK'><pre id='tSRMK'><center id='tSRMK'></center></pre></bdo></b><th id='tSRMK'></th></span></q></dt></tr></i><div id='tSRMK'><tfoot id='tSRMK'></tfoot><dl id='tSRMK'><fieldset id='tSRMK'></fieldset></dl></div>
                  1. <legend id='tSRMK'><style id='tSRMK'><dir id='tSRMK'><q id='tSRMK'></q></dir></style></legend><tfoot id='tSRMK'></tfoot>
                    • <bdo id='tSRMK'></bdo><ul id='tSRMK'></ul>

                    <small id='tSRMK'></small><noframes id='tSRMK'>