I already added line through custom view but leading & trailing do not work properly according to device width. How i can can add following separator line in view and handle it through auto layouts.
Asked
Active
Viewed 100 times
0

Shahbaz Akram
- 1,598
- 3
- 28
- 45
-
Leading & trailing do not work properly according to device width What is issue you are getting – Prashant Tukadiya Nov 08 '17 at 08:30
-
check this screen short . http://prntscr.com/h7owvk – Shahbaz Akram Nov 08 '17 at 09:36
-
Consider adding more detail about how you want the separators spaced. As written, it's unclear what your final goal is. Do you want the lines centered between the content areas? Are they fixed width? Are they supposed to occupy a certain ratio of the screen? Without knowing how you want things to look, it's hard to give advice on how to move forward. – Stonz2 Nov 08 '17 at 20:21
1 Answers
1
I think it is issue of your three view is not properly set
Give Constraints like below
1) Add 3 View and give equal width and height constraints
2) Left View -> Leading ->Top -> Bottom -> Fixed Height (whatever you need)
3) Left Seperator -> -> Leading (Left View) -> Centre Vertically (Left View) -> Fixed Width (Any Constant) -> Fixed Height (Any Constant)
4) Centre View -> Leading (Left Seperator) -> Top -> (Left View) -> Bottom ->(LeftView)
5) Right Seperator -> -> Leading (Centre View) -> Centre Vertically (Left View) -> Fixed Width (Same as left) -> Fixed Height (Same as left)
6) Right View -> Leading (Right Seperator) -> Top -> (Left View) -> Bottom ->(LeftView) - > Trailing (main view)
Hope it is helpful to you

Prashant Tukadiya
- 15,838
- 4
- 62
- 98