码迷,mamicode.com
首页 >  
搜索关键字:cgrect    ( 583个结果
iOS 设置button中图文位置
方法一. -(CGRect)imageRectForContentRect:(CGRect)contentRect { return CGRectMake(self.width - kImageW, 0, kImageW, self.height);}-(CGRect)titleRectForCon ...
分类:移动开发   时间:2016-07-12 18:49:16    阅读次数:154
自定义BadgeView
-(instancetype)initWithFrame:(CGRect)frame{ if (self=[super initWithFrame:frame]) { self.userInteractionEnabled=NO; [self setBackgroundImage:[UIImage ...
分类:其他好文   时间:2016-07-08 17:49:38    阅读次数:208
Swift之控件-UIlabel
let label = UILabel(frame:CGRect(x: 20,y: 100,width: 280,height: 40)) label.text = "理想接电话是否很沮丧和甲方狙击手的开发可谓文件的附件二反馈句" label.backgroundColor = UIColor.bl ...
分类:编程语言   时间:2016-07-07 16:59:49    阅读次数:199
UIScrollView增加刷新
1、 if (!self.scrollView) { CGRect frame = CGRectMake(0.0, 0.0, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame)); UIScrollView *scrol ...
分类:其他好文   时间:2016-07-04 23:42:45    阅读次数:271
获取UILabel宽度的方法
- (CGFloat)heightOfDetailView{ CGFloat left = 13; CGRect maxBounds = CGRectMake(left, 0, SCREEN_WIDTH - left * 2, MAXFLOAT); UILabel *label = [UILabel ...
分类:其他好文   时间:2016-06-28 02:05:20    阅读次数:162
CGContextRef 绘图
如何绘制一个矩形 添加一个属性 @property(nonatomic,strong) NSString* RectNumber; 1. 首先重写UIview的drawRect方法 - (void)drawRect:(CGRect)rect { CGContextRef ctx = UIGraphi ...
分类:其他好文   时间:2016-06-27 01:33:08    阅读次数:196
iOS支持图文混排的按钮(UIButton)
创建UIButton子类 直接上代码了 .h文件 .m文件 #import "GraphicBtn.h" @implementation GraphicBtn - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame] ...
分类:移动开发   时间:2016-06-24 12:16:55    阅读次数:234
修改一个CGRect的值
// 1. 用一个临时变量保存返回值。 CGRect temp = self.view.frame; // 2. 给这个变量赋值。 temp.size.width = kWIDTH; // 3. 修改frame的值 self.view.frame = temp; ...
分类:其他好文   时间:2016-06-21 15:29:57    阅读次数:281
UILabel
/******label随字体改变宽度******/+ (CGSize)sizeWithString:(NSString *)string font:(UIFont *)font{CGRect rect = [string boundingRectWithSize:CGSizeMake(CGFLOA ...
分类:其他好文   时间:2016-06-17 09:50:10    阅读次数:229
Quartz 2D:初识
在UIView中重写drawRect方法 - (void)drawRect:(CGRect)rect { [self drawLine]; } #pragma mark 画线操作 - (void)drawLine{ //1、获取上下文-UIView对应的上下文 CGContextRef contex ...
分类:其他好文   时间:2016-06-15 16:01:44    阅读次数:140
583条   上一页 1 ... 8 9 10 11 12 ... 59 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!