Recently the company has been doing dynamic scaling, and here are some practical lessons about customizing input box controls:
Comparison of enlarged situations before and after modification:
UI tweaks:
- The first consideration is that if you turn on dynamic Font, you won’t be able to change the ORIGINAL UI without zooming in.
- Dynamic Font is enabled by setting the property.
- Adjust constraints between controls to fix zooming bugs.
With dynamic font, lineHeight ADAPTS when not zooming in.
- DynamicScaledFont is enabled on the label, a new UIFont object is generated. Resetting the font will update minimumLineHeight. The new object does not match the font type, and the system lineHeight is returned.
InitialHeight and actualHeight.
- To not affect TK, keep the old initialHeight and actualHeight.
- New dynamicInitialHeight and dynamicActualHeight, which are the actual height of the control after page rendering.
- The values of the actual layout are used, but may be buggy because of the page lag.
The collectionView jumps up and down when refreshed using PerformBat updates.
- Attempting to customize FloatLayout failed to obtain the specific cell height. Procedure To give up.
- Try not to give estimatedItemSize the preset modify collectionViewCell preferredLayoutAttributesFitting inside, still beating. To give up.
CollectionView formSelectDoubleLine, helperText cannot be adapted.
The resources
- Dynamic Cell Sizing in UICollectionView
- Custom Collection View Layout — A Simple Template