How can I set this constrains in code ?
You might want to have a look at this...
Creating layout constraints programmatically
or this..
Change height constraint programmatically