Summary of development experience-Experience Accumulation and Experience Accumulation
To see a new interface, we need to carefully divide the area. How should we design it properly.
1. if there are several lines in a cell, each line has two labels, and the Rule layout is the same, this is very good, but the data returned by the interface may be dynamic, sometimes 5 rows and sometimes 7 rows, in this case, let several lines in a cell be split into multiple cells, each row is a cell, and a new cell is created separately. In cellForRow, instead of loading the original cell, instead, load different cells and pass in different data sources.
2. the requirement is that two labels are side by side. In aotolayout, the label is not fixed width. The label on the left must be dynamically filled in data, and the label on the right must always be 20 width away from the labelon the left, how can this be done? First, the label on the Left cannot be set to a fixed width. In this way, the label is set to a fixed width first, and then the edit width is> = a small value (20). Then, you can compile the label and enter the data dynamically, the label can automatically stretch the width, and the label on the right is set to 20 to the left.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.