3
Reply

What is difference between Bounds and Frame

Pravesh Dubey

Pravesh Dubey

5y
2.7k
0
Reply

    Frame: a view’s location and size using parent’s view coordinate system. Bounds: a view’s location and size using it’s own coordinate system.

    The bounds refers to its coordinates relative to its own space (as if the rest of your view hierarchy didn’t exist), whereas its frame refers to its coordinates relative to its parent’s space.

    - frame = a view’s location and size using the parent view’s coordinate system

    1. Important for: placing the view in the parent

    bounds = a view’s location and size using its own coordinate system

    1. Important for: placing the view's content or subviews within itself