转自:http://www.maxiaoguo.com/clothes/252.html
基本图形的绘制 包括: 代码画线,画文字 图片 裁剪 重绘 简单动画
当自定义view的时候 系统会自动调用drawRect 方法
画线
[objc] view
plain copy
- (void)drawRect:(CGRect)r...
分类:
移动开发 时间:
2016-05-06 15:54:05
阅读次数:
227
围绕着某一块特定区域显示(箭头指定那块特定区域) - (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDire ...
分类:
其他好文 时间:
2016-04-29 21:45:04
阅读次数:
174
// controllerA 中有一个UITableView, UITableView里有多行UITableVieCell,cell上放有一个button // 在controllerA中实现: CGRect rc = [cell convertRect:cell.btn.frame toView: ...
分类:
其他好文 时间:
2016-04-29 14:24:10
阅读次数:
171
//控制placeHolder的位置,左右缩20 -(CGRect)placeholderRectForBounds:(CGRect)bounds { CGRect inset = CGRectMake(bounds.origin.x+100, bounds.origin.y, bounds.siz ...
分类:
其他好文 时间:
2016-04-26 00:36:26
阅读次数:
239
#import<UIKit/UIKit.h>@interfaceweixinControl:UIControl-(weixinControl*)initWithFram:(CGRect)rect;@end#import"weixinControl.h"@implementationweixinControl{CGRect_rect;//记录self.frame的大小UIView*_frontView;//用来显示主要内容CGPoint_originPoint;//记录..
分类:
微信 时间:
2016-04-24 19:01:19
阅读次数:
376
- (void)setBounds:(CGRect)bounds { [super setBounds:bounds]; if (bounds.size.width != self.preferredMaxLayoutWidth) { self.preferredMaxLayoutWidth = s ...
分类:
其他好文 时间:
2016-04-22 13:31:33
阅读次数:
113
//添加边框和提示 CGRect frameRect = CGRectMake(20, 90, self.window.frame.size.width-40, self.window.frame.size.height-180); UIView *frameView = [[UIView allo ...
分类:
其他好文 时间:
2016-04-22 13:17:05
阅读次数:
152
static CGRect oldframe; -(void)showImage:(UIImageView *)avatarImageView{ UIImage *image=avatarImageView.image; UIWindow *window=[UIApplication sharedA ...
分类:
其他好文 时间:
2016-04-21 13:25:08
阅读次数:
151
需求: 点击cell上的图片.图片以原图显示出来,可以放大或缩小.再次点击图片移除图片显示原来界面.(和QQ空间看图片类似) 点击图片实现效果: 1. 自定义一个 UITableView (KDImageDetailTableView) 在方法(- (id)initWithFrame:(CGRect ...
分类:
移动开发 时间:
2016-04-20 18:03:06
阅读次数:
357
http://stackoverflow.com/questions/19274408/drawinrectwithattributes-vs-drawinrectwithfontlinebreakmodealignment- (void)drawRect:(CGRect)frame{ NSMuta ...
分类:
移动开发 时间:
2016-04-18 16:56:46
阅读次数:
178