摘要: 本文转载至 :http://www.cocoachina.com/bbs/simple/?t116558.html做过Android应该都知道相对布局这个概念,一个控件以另一个控件为参照进行布局,那么即使屏幕变化,布局也会随着进行微调,以达到良好的视觉效果并且保持了代码的可拓展性。随着iPhone5 的面世,iPhone的屏幕比例也失调了。今年的WWDC就有了iOS的新特性auto layout,当然这个自己也还在学习当中。这里就把自己这几天的收获记录下…..首先讲讲auto Layout在xib中的应用,这里有两篇raywenderlich网站的帖子讲的非常好,讲得很透彻,本人跟着步骤一步一 阅读全文
posted @ 2013-06-05 17:27 天牛 阅读(153) 评论(0) 推荐(0)
摘要: 本文转载至:http://www.cnblogs.com/pengyingh/articles/2379476.htmladdSubview:添加一个子视图到接收者并让它在最上面显示出来。- (void)addSubview:(UIView *)view讨论这方法同样设置了接收者为下一个视图响应对象。接收者保留视图。如果你使用removeFromSuperview方法用来把视图移除他的显示列表,那么视图将会被释放。如果你想要在视图移除显示列表後保留并使用这个视图(如果,举个例子,你想要交换一些视图的位置。),你不许保留那个视图在他调用removeFromSuperview前。bringSubv 阅读全文
posted @ 2013-06-05 14:11 天牛 阅读(186) 评论(0) 推荐(0)
摘要: 本文转载至 :http://gaohaijun.blog.163.com/blog/static/17669827120113193939499/UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, self.view.opaque, 0.0f);[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];UIImage * img = UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImag 阅读全文
posted @ 2013-06-05 13:40 天牛 阅读(142) 评论(0) 推荐(0)
摘要: NS_CLASS_AVAILABLE_IOS(2_0)@interfaceUIApplication:UIResponder<UIActionSheetDelegate> 本文转载至http://blog.csdn.net/jpcfei/article/details/9000273{//获取UIApplication单例对象+(UIApplication*)sharedApplication;//应用程序委托对象@property(nonatomic,assign)id<UIApplicationDelegate>delegate;-(void)beginIgnori 阅读全文
posted @ 2013-06-05 13:02 天牛 阅读(471) 评论(0) 推荐(0)
摘要: #import<UIKit/UIKit.h>@interface TestGestureRecognizerViewController : UIViewController { UIView *aView;}@property(nonatomic,retain)IBOutlet UIView *aView;@end///////////////////////////////////////////////////////////////////////////////////////////////#import"TestGestureRecognizerViewCo 阅读全文
posted @ 2013-06-05 11:06 天牛 阅读(155) 评论(0) 推荐(0)
摘要: //***宏定义#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640,1136), [[UIScreen mainScreen] currentMode].size) : NO)然后:if(iPhone5){//***具体操作}else{//***具体操作} 阅读全文
posted @ 2013-06-05 10:58 天牛 阅读(123) 评论(0) 推荐(0)
摘要: 本文转载至 http://blog.csdn.net/namehzf/article/details/7424882 天牛 不胜感激UIGestureRecognizer是一个具体手势的基类,提供了较为简单的手势实现方式 The concrete subclasses ofUIGestureRecognizerare the following:UITapGestureRecognizerUIPinchGestureRecognizerUIRotationGestureRecognizerUISwipeGestureRecognizerUIPanGestureRecognizerUILongP 阅读全文
posted @ 2013-06-05 10:38 天牛 阅读(380) 评论(0) 推荐(0)