view-bound

how to get current size of a subview when device size changes in swift?

本秂侑毒 提交于 2019-12-20 04:58:15
问题 I have to view: view_1 and view_2 . view_1 height is proportional to the main view controller height and I am adding view_2 programmatically as a subview of view_1 with a proportional height. Problem when the device size changes say from iPhone 6 to iPhone 5, the view_1 adjust correctly but its height I am passing to a function to draw its subview view_2 is still what was set in interface builder and so it is out of bounds in iPhone 4 moving from iPhone 6 Thus I want to know how can I get the

how to get current size of a subview when device size changes in swift?

耗尽温柔 提交于 2019-12-02 02:49:38
I have to view: view_1 and view_2 . view_1 height is proportional to the main view controller height and I am adding view_2 programmatically as a subview of view_1 with a proportional height. Problem when the device size changes say from iPhone 6 to iPhone 5, the view_1 adjust correctly but its height I am passing to a function to draw its subview view_2 is still what was set in interface builder and so it is out of bounds in iPhone 4 moving from iPhone 6 Thus I want to know how can I get the correct size of a view that what resize automatically to fit the current device? The size of the view