1.30总结

 

 

 

一:想成为单例的三个步骤

1,在H文件中导入第三方框架#import “Singleton.h”;

2,在H文件中写:#define singleton_interface(className)

3.在M文件中写:#define singleton_implementation(className)

二,如何使视图不从导航栏底下显示

1,判断

#define iOS7 ([[UIDevice currentDevice].systemVersion doubleValue] >= 7.0)

 

2.使用:if (iOS7) {

        self.edgesForExtendedLayout=UIRectEdgeNone;

    }

三,如何实现自动伸缩?

     对于iphone项目一般不需要横竖屏适配,但对于ipad项目一般需要横竖屏适配。具体实现为:

 UIViewAutoresizingNone就是不自动调整。

UIViewAutoresizingFlexibleLeftMargin 自动调整与superView左边的距离,保证与superView右边的距离不变。

UIViewAutoresizingFlexibleRightMargin 自动调整与superView的右边距离,保证与superView左边的距离不变。

UIViewAutoresizingFlexibleTopMargin 自动调整与superView顶部的距离,保证与superView底部的距离不变。

UIViewAutoresizingFlexibleBottomMargin 自动调整与superView底部的距离,也就是说,与superView顶部的距离不变。

UIViewAutoresizingFlexibleWidth 自动调整自己的宽度,保证与superView左边和右边的距离不变。

UIViewAutoresizingFlexibleHeight 自动调整自己的高度,保证与superView顶部和底部的距离不变。

posted @ 2015-03-05 08:30  深山一枯柴  阅读(105)  评论(0编辑  收藏  举报