iOS User Defined Runtime Attributes to define the key path

Next, add a button to the top right of each view controller. For both buttons, double-click and press backspace to set the button title to an empty string.
Screenshot 2014-10-23 12.16.11
Also set each button’s background color to black.
Now it’s time to position the buttons with Auto Layout. Select the button on the first view controller, then select the Pin button in the lower-right corner, and configure it as follows:
Click the light red brackets for the top and right, and set them each to 10
Set the Width and Height to 44
Set Update Frames to Items of New Constraints

PinConstraints2
Click Add 4 Constraints, and the button will resize. Repeat this for the other button as well.
The last thing to configure is the shape of the buttons — you need to make them circular by setting a corner radius. Rather than painstakingly coding it, switch to the Identity Inspector and use the User Defined Runtime Attributes to define the key path and set the cornerRadius
 for the button’s layer.
Screenshot 2014-10-23 12.54.26
Interface Builder will not reflect the circular shape of the buttons, but build and run your app and you’ll see a black circle in the top right corner.
iOS Simulator Screen Shot Nov 3, 2014, 10.27.11 PM

摘自:http://www.raywenderlich.com/86521/how-to-make-a-view-controller-transition-animation-like-in-the-ping-app

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值