07 2013 档案
scrollsToTop小结
摘要:scrollsToTop小结UIScrollView是用来展示滚动的一个类。他有UITableView、UITextView等子类,scrollsToTop是UIScrollView的一个属性,主要用于点击设备的状态栏时,是scrollsToTop == YES的控件滚动返回至顶部。每一个默认的UIScrollView的实例,他的scrollsToTop属性默认为YES,所以要实现某一UIScrollView的实例点击设备状态栏返回顶部,则需要关闭其他的UIScrollView的实例的scrollsToTop属性为NO,很好理解,若多个scrollView响应返回顶部的事件,系统就不知道到底要 阅读全文
posted @ 2013-07-18 21:51 nanoCramer 阅读(2486) 评论(0) 推荐(1)
查看UIWindows的视图层次
摘要:忘记从哪里看到的这个了,不过非常有用,记录下来!// Recursively travel down the view tree, increasing the indentation level for children- (void)dumpView:(UIView *)aView atIndent:(int)indent into:(NSMutableString *)outstring{for (int i = 0; i < indent; i++) [outstring appendString:@"--"];[outstring appendFormat: 阅读全文
posted @ 2013-07-18 21:31 nanoCramer 阅读(231) 评论(0) 推荐(0)
弹出框适配总结
摘要:1、屏幕旋转显示视图时,尽量不用单一的view去实现,将view放在viewcontroller里实现,这样可以在viewController中去添加其旋转方法,实现适配屏幕旋转。(1)支持全部方向的旋转iOS6.0需要下面三个方法,代码如下:-(BOOL) shouldAutorotateToInterfaceOrientation : (UIInterfaceOrientation) toInterfaceOrientation{ return(toInterfaceOrientation !=UIInterfaceOrientationMaskPortraitUpsideDown);}- 阅读全文
posted @ 2013-07-16 10:20 nanoCramer 阅读(334) 评论(0) 推荐(0)
关于IOS获取keyBoard键盘是否弹出
摘要:工程中需要需要实现自定义的弹出提示框,暂时的实现方法是alloc一个view出来,以subView的方式加在底部的webView上面正中间,这样在keyboard弹出时,提示框被遮住,需要修改。既然是keyBoard引起的问题,那我们就获取keyBoard弹出的状态,如果是弹出状态,那么调整位置,使提示框能正常显示。我们在ViewDidLoad里添加下面俩个方法:[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowN 阅读全文
posted @ 2013-07-08 20:12 nanoCramer 阅读(1237) 评论(0) 推荐(0)