简体   繁体   中英

make bottom edge of button 1 and top edge of button 2 placed under button 1 vertically centre align?

I am developing an ios application in xcode 5.1 using story boards for ios 7.1. I have 2 buttons placed one on top of the other. Take for instance button "done" is top and button "nest page" is below button "done". There is no space between bottom edge of button "done" and top edge of button "nest page". I would like to vertically centre align both the buttons on the right side of the screen.

在此处输入图片说明

You could put the two buttons into another UIView. Center that wrapper view vertically and make it match the size of the two buttons.

Like it is done in the following screenshot. Note that I expanded the yellow wrapper view to the left side so you can see how this is supposed to work. You don't want to do this in your app.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM