Anyone has an example of a “page” being created wi...
# ios
Anyone has an example of a “page” being created with content (UIView, UIImageView, etc.) on Kotlin? My goal is to have a function that returns a complete page, but I’m having a hard time figuring out how to place everything correctly
Does one need to always have a rectangle frame? That seems strange that we can’t align something without it
iOS views have an intrinsic content size, aka a size that they would like to be. In general you should always use
translatesAutoresizingMaskIntoConstraints = false
and autolayout to arrange your views. Unfortunately it isn’t an easy thing to use. The main key to remember is that constraints for a a view must always specify the x, y, height & width to be valid. Also try to avoid situations where multiple values will satisfy an autolayout equation, something like x + y = 4. In those situations you will end up with an ambiguous layout that may look ok in one situation but not in another.
gotcha! thank you