iOS 7 圆形框架按钮

iOS 7 round framed button(iOS 7 圆形框架按钮)
本文介绍了iOS 7 圆形框架按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS App Store 有一个蓝色圆形框架按钮​​,用于购买/下载应用程序.

the iOS App Store has a blue round framed button for buying/downloading apps.

在我的应用程序中,您可以下载其他内容,我希望有一个类似的按钮,只是因为它对用户来说看起来很熟悉.

In my App you can download additional content and I want to have a similar button, just because it looks familiar to the user.

如果你不知道,我的意思是:这些按钮,比如$3.99"

If you don't know, what I mean: these buttons, like "$3.99"

这怎么可能?

推荐答案

您可以很容易地操作按钮的 CALayer.

You can manipulate the CALayer of your button to do this pretty easily.

// assuming you have a UIButton or more generally a UIView called buyButton

buyButton.layer.cornerRadius = 2;
buyButton.layer.borderWidth = 1;
buyButton.layer.borderColor = [UIColor blueColor].CGColor;
// (note - may prefer to use the tintColor of the control)

您可以调整其中的每一个以获得所需的颜色和边框效果.

you can tweak each of those to get the color and border effect you want.

您还必须在要使用 CALayers 的任何文件中添加导入

You will also have to add an import in any file you want to use CALayers

#import <QuartzCore/QuartzCore.h>

这篇关于iOS 7 圆形框架按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)