iOS 圆形布局代码笔记
来源:互联网 发布:java super.m = 10 编辑:程序博客网 时间:2024/06/02 02:07
#define degreesToRadians(degrees) ((degrees * (float)M_PI) / 180.0f)
float dist = 100;//半径
for (int i=1; i<=10;i++) {
float angle = degreesToRadians((360 /10) * i);
float y = cos(angle) * dist;
float x = sin(angle) * dist;
UIButton *btn = [UIButtonbuttonWithType:UIButtonTypeCustom];
btn.width =60;
btn.height =60;
btn.layer.cornerRadius =30;
btn.layer.masksToBounds =YES;
[btn setBackgroundColor:[UIColorwhiteColor]];
CGPoint center = CGPointMake(v.center.x + x,v.center.y + y-80);
btn.center = center;
[vaddSubview:btn];
}
0 0
- iOS 圆形布局代码笔记
- ios 创建圆形布局
- IOS布局笔记一(代码实现自动布局)
- iOS: 学习笔记, 用代码驱动自动布局实例
- iOS: 学习笔记, 用代码驱动自动布局实例(swift)
- ios autolayout代码布局
- iOS代码布局
- iOS AFL代码布局
- 浅谈IOS的代码布局
- iOS AutoLayout 代码布局自动化
- IOS页面布局 纯代码
- iOS CGRectDivide布局(代码举例)
- iOS 纯代码控件布局
- IOS代码实现自动布局
- java圆形布局
- flex 圆形布局
- flex 圆形布局
- 安卓圆形布局
- Codeforces Round #253 DIV1 C 贪心
- 算法的力量——李开复
- 增强for循环、Map接口遍历、可变参数方法
- UVa 1645Count
- 使用Apriori算法进行关联分析
- iOS 圆形布局代码笔记
- 装饰者模式
- android反编译工具总结
- 理解 pkg-config 工具
- JMeter使用记录3 -- 性能监控插件jmeter-plugins
- 使用框架的php如果使用定时服务Cronjob
- 深入Pthread(五):线程属性
- UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128)
- HDUJ 1203 I NEED A OFFER!