码迷,mamicode.com
首页 >  
搜索关键字:cgrect    ( 583个结果
IOS Quartz2D简介
Quartz2D 简介( 后续会有相关应用) 第一部分 绘制直线 代码示例: - (void)drawRect:(CGRect)rect{ //获取图形上下文 CGContextRef cxContext = UIGraphicsGetCurrentContext(); //开始画图 //设置直线起 ...
分类:移动开发   时间:2017-06-18 22:41:48    阅读次数:223
swift 实践- 11 -- UISlider
import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let slider = UISlider.init(frame: CGRect.init( ...
分类:编程语言   时间:2017-06-09 19:26:38    阅读次数:167
swift 实践- 03 -- UILabel
class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // 标签 let label: UILabel = UILabel(frame: CGRect(x: 100, y: ...
分类:编程语言   时间:2017-06-09 14:13:54    阅读次数:128
UISearchBar作为inputAccessoryView时的响应链
UISearchBar对象做为一个普通的视图对象加入到视图控制器的self.view中,定义、初始化、设置delegate。然后becomeFirstResponder,最后resignFirstResponder。 CGRect searchBarFrame= CGRectMake(0, 0, s ...
分类:数据库   时间:2017-06-04 13:48:14    阅读次数:247
监听键盘frame变化
/** * 监听键盘的弹出和隐藏 */ - (void)keyboardWillChangeFrame:(NSNotification *)note { // 键盘最终的frame CGRect keyboardF = [note.userInfo[UIKeyboardFrameEndUserInf... ...
分类:其他好文   时间:2017-05-31 00:24:24    阅读次数:142
iOS 切屏方法
点击要切屏时点用此方法获取图片 image 极为切屏图片 - (UIImage *)captureImageFromView:(UIView *)view { CGRect screenRect = [view bounds]; UIGraphicsBeginImageContext(screenR ...
分类:移动开发   时间:2017-05-26 13:20:46    阅读次数:230
ios假设写一个提示带动画的View,能够来引导用户行为
先上图: 这个UIView能够这样写: -(id)initWithFrame:(CGRect)frame backImage:(UIImage*)image msgStr:(NSString*)txt txtColor:(UIColor*)color{ self = [super initWithF ...
分类:移动开发   时间:2017-05-24 21:09:07    阅读次数:227
IOS 使用XIB 自定义View
一般自定义View 代码方式 有 在初始化的时候添加 子Views 还有种 是自己画。 重载 - (void)drawRect:(CGRect)rect { } 如果 布局复杂的话 这种代码方式 可以郁闷死人 看不到效果,慢慢调 ,代码冗长。。。 所以可以用到 XIB 来进行布局。 UIViewCo ...
分类:移动开发   时间:2017-05-20 01:08:30    阅读次数:248
简洁的ios小界面
下午写写了个小东西小界面 有须要的能够直接拿过来用 ,简洁,挺好看,自我感觉; 写界面事实上就是自上而下的在view加空间,注意一下位置即可了 - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (se ...
分类:移动开发   时间:2017-05-16 11:11:02    阅读次数:213
iOS 获取导航栏和状态栏的高度
CGRect rect = [[UIApplication sharedApplication] statusBarFrame]; 状态栏的高度: float status height = rect.size.height; 导航栏的高度: float navigationheight = sel ...
分类:移动开发   时间:2017-05-14 12:29:33    阅读次数:242
583条   上一页 1 ... 3 4 5 6 7 ... 59 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!