码迷,mamicode.com
首页 >  
搜索关键字:cgrect    ( 583个结果
scrollview滚动到指定区域的两种方法
方法一:利用偏移量来滚动- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated;方法二:利用rect来滚动- (void)scrollRectToVisible:(CGRect)rect animated:(BO...
分类:其他好文   时间:2015-07-08 02:04:44    阅读次数:500
自定义UIBtton类后,在@implementation重写方法的作用
1 /** 2 * 用来自定义imageView的尺寸和位置 (contentRect等于按钮的bounds) 3 */ 4 - (CGRect)imageRectForContentRect:(CGRect)contentRect { 5 return CGRectMake((co...
分类:其他好文   时间:2015-07-08 00:22:21    阅读次数:146
计算文本的高度BoundingRectWithSize:options:context
- (CGRect)boundingRectWithSize:(CGSize)sizeoptions:(NSStringDrawingOptions)optionscontext:(NSStringDrawingContext*)context解释一下三个参数1) size用于限制尺寸,计算机绘制时...
分类:其他好文   时间:2015-07-07 12:28:38    阅读次数:71
iOS下划线/虚线/删除线等等
1.实线,(下划线/删除线) 写一个新类 UnderLineLabel : UILabel - (void)drawRect:(CGRect)rect { // Drawing code [super drawRect:rect]; CGContextRef ctx = UIGraphicsGetCurrentContext(); CGSize f...
分类:移动开发   时间:2015-07-07 11:08:01    阅读次数:253
iOS 去掉UITableView风格为group时候的最顶部的空白距离
CGRect frame=CGRectMake(0, 0, 0, CGFLOAT_MIN);   self.tableView.tableHeaderView=[[UIView alloc]initWithFrame:frame];   CGFLOAT_MIN 这个宏表示 CGFloat 能代表的最接近 0 的浮点数,64 位下大概是 0.00(300左右个)0225 这个样子 这样写单纯...
分类:移动开发   时间:2015-07-06 14:17:04    阅读次数:129
IOS开发之控件frame/bounds/center尺寸改变小技巧-简单给UIView新增分类(github链接)
大家是否还记得对控件的frame/bounds/center进行属性更改时的三部曲? 1>将结构体取出 2>改变取出后的结构体对应的数据 3>将修改后的结构体赋值给控件 CGRect frame = self.view.frame; // your code... frame.origin.x = frameX; // your code... se...
分类:移动开发   时间:2015-07-06 10:23:25    阅读次数:145
UIColor和UIImage转换
UIColor 转UIImage - (UIImage*) createImageWithColor: (UIColor*) color {     CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);     UIGraphicsBeginImageContext(rect.size);     CGContextRef c...
分类:其他好文   时间:2015-07-05 16:55:50    阅读次数:160
iOS 自定义UINavigationController返回按钮
主要代码如下://自定义导航栏返回按钮 self.navigationItem.leftBarButtonItem = ({ //导航栏返回背景视图 UIView *view = [[UIView alloc]initWithFrame:CGRect...
分类:移动开发   时间:2015-07-03 14:00:11    阅读次数:238
封装代理
LTView.h@interface LTView : UIView { UILabel *_lable; UITextField *_textField; }#pragma mark - 自定义初始化方法 - (instancetype)initWithFrame:(CGRect)frame text:(NSString *)te...
分类:其他好文   时间:2015-07-03 00:19:46    阅读次数:113
利用Quartz2D推图的另一个方法 (使用CGMutalePathRef进行分层次)
可以利用 CGMutablePathRef 创建每个不同图形,然后再一起添加到CGContext中- (void)drawRect:(CGRect)rect{ CGContextRef ctx = UIGraphicsGetCurrentContext(); //一、 画线 ...
分类:Web程序   时间:2015-07-02 20:48:18    阅读次数:151
583条   上一页 1 ... 31 32 33 34 35 ... 59 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!