cocoa touch - How to make a fluid layout in iOS? -
What is the correct way to create a fluid layout in iOS, in the sense that the hidden elements do not take place anymore?
I have a table view in each cell, which has a customized detail-type view with a row with headline, subtitle and some additional information:
Additional information Three pairs of icons And a label can be a price. The layout of all ideas inside the cell is done using autolayouts with missing or ambiguous obstacles.
What would I want to achieve, when that value is 0, then the icon and label are not displayed and
if I just set the setHidden:
method If I use, the width of the hidden part is not changed, so that's just white space, but no ideas have gone. Example:
It should look like this:
I have tried to follow the approach with creating a lack of layout for four frames that should be set to zero: the width of the heart-shaped icon, the width of the labeled value, both of them White space between the middle and the white space between the label and the next icon. This does not work because I could not compromise the layout constraints in the code in the outlet, and there is also a simple method for something that should be a normal scenario.
Edit: I fixed the problem with the shops for obstacles: To do this, to create a subclass for the table cell and to create an outlet for the barriers there is.
I mention something to do with "normal scenario" in the web design, where it is easy to set display
style to none
And the desired effect happens I hope there is something simple in this way in iOS.
I am thinking of using the collection scene with reusable cells, but then I need to set up a representative and a data source and everything else, and before that I I want to make sure that I want to make sure that it's the way to do it.
Do not need to remove a hidden view, connect to the barrier for an outlet in the code, and When you detect a scene is hidden, then reduce the continuation of the barrier, then again, in the cell prepareForReuse
, remember to continuously return to the right value of the obligation.
Comments
Post a Comment