创建NSTextAttachment的对象,用来装在图片 将NSTextAttachment对象的image属性设置为想要使用的图片 设置NSTextAttachment对象bounds大小,也就是要显示的图片的大小 用[NSAttributedString attributedStringWith ...
分类:
其他好文 时间:
2016-08-11 12:49:18
阅读次数:
162
- (void)savePicToPhotoes { UIGraphicsBeginImageContext(self.view.bounds.size); CGContextRef ref = UIGraphicsGetCurrentContext(); [_board.layer renderI ...
分类:
其他好文 时间:
2016-08-09 15:02:51
阅读次数:
191
一、UIVIew 属性 1.frame 位置和尺寸(以父控件的左上角为原点(0,0)) 2.center 中点 (以父控件的左上角为原点(0,0)) 3.bounds 位置和尺寸(以自己的左上角为原点 (0,0)) 4.transform 形变属性(缩放,旋转) 5.backgroundColor ...
分类:
其他好文 时间:
2016-08-08 14:16:37
阅读次数:
141
Geometric Objects object.area Returns the area (float) of the object. object.bounds Returns a (minx, miny, maxx, maxy) tuple (float values) that bound... ...
分类:
其他好文 时间:
2016-08-07 18:24:06
阅读次数:
202
函数格式scipy.optimize.linprog(c, A_ub=None, b_ub=None, A_eq=None, b_eq=None, bounds=None, method='simplex', callback=None, options=None)今天阅读数据建模第一章线性规划问题 ...
分类:
编程语言 时间:
2016-08-07 10:55:30
阅读次数:
1359
1、问题:加载UIWebView底部有黑色边框问题。 设置UIWebView opaque为NO,然后设置其背景色为clearColor。 2、问题:iPhone真机输出[UIScreen mainScreen].bounds.size.width 不符合常规逻辑问题。(iPhone6s输出320, ...
分类:
移动开发 时间:
2016-08-05 15:42:17
阅读次数:
204
在iOS中获取UIView的所有层级结构 应用场景 在实际 iOS 开发中,很多时候都需要知道某个 UI 控件中包含哪些子控件,并且分清楚它们的层级结构和自个的 frame 以及 bounds ,以便我们完成复杂的 UI 布局,下面的代码就能很方便的获取某个 UI 控件的所有的层级结构,我们可以用它 ...
分类:
移动开发 时间:
2016-08-04 23:17:59
阅读次数:
583
//给某个view增加颜色透明度渐变图层 - (void) insertTransparentGradient { NSLog(@"%@",NSStringFromCGRect(self.imgView.bounds)); UIColor *colorOne = [UIColor colorWith ...
分类:
其他好文 时间:
2016-08-02 19:01:01
阅读次数:
174
iOS开发UI基础—手写控件,frame,center和bounds属性 一、手写控件 1.手写控件的步骤 (1)使用相应的控件类创建控件对象 (2)设置该控件的各种属性 (3)添加控件到视图中 (4)如果是button等控件,还需考虑控件的单击事件等 (5)注意:View Contollor和vi ...
分类:
移动开发 时间:
2016-07-30 12:02:20
阅读次数:
221
// Override point for customization after application launch. //初始化window, 大小为设备物理大小 self.window = UIWindow(frame: UIScreen.mainScreen().bounds) //把wi ...
分类:
编程语言 时间:
2016-07-29 19:00:55
阅读次数:
153