如何制作像iOS 7锁屏一样的圆形按钮 [英] how to make round buttons like the iOS 7 lock screen

查看:85
本文介绍了如何制作像iOS 7锁屏一样的圆形按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有预定义的小部件可以在iOS7中使用圆形按钮,就像锁定屏幕一样?我一直在寻找UIButton,但我找不到任何东西。所以他们不是UIButtons,或者我没有看到它,或者它们只是不存在而且我必须自己创建自定义按钮。

Is there a predefined widget to make have round buttons in iOS7 like with the lock screen? I've been looking around at UIButton but I couldn't find anything. So their they're not UIButtons, or I'm not seeing it, or they just don't exist and I have to make my own custom buttons.

推荐答案

在构建步骤中链接框架然后

Link the framework in build steps then

导入:

#import QuartzCore/QuartzCore.h

代码:

self.fiveButton.layer.cornerRadius = self.fiveButton.bounds.size.width/2.0;
self.fiveButton.layer.borderWidth = 1.0;
self.fiveButton.layer.borderColor = self.fiveButton.titleLabel.textColor.CGColor;
self.fiveButton.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:35];

这不是完全正确:我没有标签向上移动(有插入)并且我没有弄清楚确切的字体,但它几乎就在那里。

This isn't exactly right: I don't have the label moved up (there are inserts for that) and I haven't figured out the exact font, but it's almost there.

https://github.com/langford/RoundButtonDemo/blob/master/screenshot.png

git@github.com:langford/RoundButtonDemo.git

git@github.com:langford/RoundButtonDemo.git

这篇关于如何制作像iOS 7锁屏一样的圆形按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆