iOS 7 round framed button(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 圆形框架按钮
基础教程推荐
- Android Volley - 如何动画图像加载? 2022-01-01
- SwiftUI-ScrollViewReader的ScrollTo不滚动 2022-01-01
- UIImage 在开始时不适合 UIScrollView 2022-01-01
- navigationItem.backBarButtonItem 不工作?为什么上一个菜单仍然显示为按钮? 2022-01-01
- Play 商店的设备兼容性问题 2022-01-01
- iOS - UINavigationController 添加多个正确的项目? 2022-01-01
- 为什么姜饼模拟器方向卡在应用程序中? 2022-01-01
- Xcode UIView.init(frame:) 只能在主线程中使用 2022-01-01
- 如何比较两个 NSDate:哪个是最近的? 2022-01-01
- 如何将图像从一项活动发送到另一项活动? 2022-01-01
