码迷,mamicode.com
首页 > 移动开发 > 详细

iOS User Defined Runtime Attributes to define the key path

时间:2015-06-19 00:05:56      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:ios

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.
技术分享
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

技术分享
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.
技术分享
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.
技术分享

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

iOS User Defined Runtime Attributes to define the key path

标签:ios

原文地址:http://blog.csdn.net/leochang130731/article/details/46553459

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!