Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove gap when using leading space on storyboard

According to my app that designed on storyboard with size class enabled and use leading space and trailing space to superview (Set to -16.0f).

Then I run it on iPad or iPhone 6 Plus. It has a little gap on both side of screen. But no gap on iPhone 5s or iPhone 4.

I know this can be done by adding a constraint for compact width or using a code. but is there anyway to setup on storyboard?
Because I don't want to sub class those view just for stretching a control.

Here is a sample when I'm running it.

Running on iPad http://s15.postimg.org/raum4qv6j/i_OS_Simulator_Screen_Shot_1_Nov_2557_9_49_38_AM.png

Running on iPhone http://s15.postimg.org/ly16cvhwb/i_OS_Simulator_Screen_Shot_1_Nov_2557_9_59_36_AM.png

** I'm using Xcode 6.1

Thank you in advance.

like image 207
Wanpaya Avatar asked Mar 19 '23 00:03

Wanpaya


1 Answers

Instead of setting the constraints for leading and trailing space set to the white bar you have the constraint for equal width with its superview. (Drag from the bar to the superview in the storyboard and select the "equal widths" from the pop-up).

like image 123
Nikos M. Avatar answered Apr 01 '23 12:04

Nikos M.