导入百度地图 初始化百度地图 mapView = [[BMKMapView alloc]initWithFrame:(CGRect){0,0,ViewWith,ViewHight}]; [self.view addSubview:mapView]; mapView.delegate = self; ...
分类:
移动开发 时间:
2016-05-13 10:25:09
阅读次数:
222
#import <UIKit/UIKit.h> @interface SSLoading : UIView - (instancetype)initWithFrame:(CGRect)frame; - (void)showLoading:(UIColor *)backgroundColor alph ...
分类:
其他好文 时间:
2016-05-13 08:20:16
阅读次数:
258
- (void)drawRect:(CGRect)rect
2 {
3 //画四边形
4 //获取图形上下文
5 CGContextRef ctx=UIGraphicsGetCurrentContext();
6 //矩阵操作
7 //注意点:设置矩阵操作必须要在添加绘图信息之前
8 //旋转45度
9 CGContextRo...
分类:
其他好文 时间:
2016-05-12 20:40:08
阅读次数:
215
- (void)drawRect:(CGRect)rect
2 {
3 //获取上下文
4 CGContextRef ctx=UIGraphicsGetCurrentContext();
5 //绘图
6 //第一条线
7 CGContextMoveToPoint(ctx, 20, 100);
8 CGContextAddLineToP...
分类:
其他好文 时间:
2016-05-12 20:11:03
阅读次数:
195
这种方法一般用于tableview,制作类似于微博浏览,空间展示动态的功能。表的高度根据图片以及字符串字数确定。
通过文字展示的最大宽度以及文字字体大小确定文字展示的高度
- (CGRect)getHeightOfText:(NSString *)text width:(CGFloat)width font:(UIFont *)font{
/*
width:设定的字符...
分类:
其他好文 时间:
2016-05-12 18:47:14
阅读次数:
124
画饼状图
- (void)drawRect:(CGRect)rect {
// Drawing code
// 需求:根据sections的数据,绘制多个扇形
// 1.获取上下文(Layer Graphics Context)
CGContextRef ctx = UIGraphicsGetCurrentContext();
...
分类:
其他好文 时间:
2016-05-12 15:26:10
阅读次数:
208
//根据一个矩形画曲线 + (UIBezierPath *)bezierPathWithRect:(CGRect)rect //根据矩形框的内切圆画曲线 + (UIBezierPath *)bezierPathWithOvalInRect:(CGRect)rect + (UIBezierPath * ...
分类:
其他好文 时间:
2016-05-09 20:18:10
阅读次数:
176
1、数据类型: CGFloat: 浮点值的基本类型CGPoint: 表示一个二维坐标系中的点CGSize: 表示一个矩形的宽度和高度CGRect: 表示一个矩形的位置和大小 typedef float CGFloat;// 32-bit typedef double CGFloat;// 64-bi ...
分类:
其他好文 时间:
2016-05-07 13:17:04
阅读次数:
115
布局/定位相关
@interface UIView(UIViewHierarchy)
- (void)setNeedsLayout;
注意:
1.在receiver标上一个需要被重新布局的标记,在系统runloop的下一个周期自动调用layoutSubviews。
- (void)layoutIfNeeded;
注意:
1.方法如其名,UIKit会判断该receiver是否需要l...
分类:
其他好文 时间:
2016-05-07 11:19:16
阅读次数:
294
前言最近在使用‘悦跑圈’这个App,其‘跑鞋展厅’功能的滚动视差效果深深地吸引了我,在网上搜罗了大量的资料,如下,我将仿照该效果简单介绍实现方法。效果演示细节实现OffsetImageCell.m- (void)cellOffset {
// 1、获取cell在屏幕中的rect
CGRect centerToWindow = [self convertRect:self.bound...
分类:
移动开发 时间:
2016-05-07 07:14:49
阅读次数:
246