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 圆形框架按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:iOS 7 圆形框架按钮

基础教程推荐