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 圆形框架按钮
基础教程推荐
- NSString intValue 不能用于检索电话号码 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
