modalPresentationStyle属性必须在presentViewController:
以前赋值, 不然无效....html
HandOutMoneyVc *handMoney = [[HandOutMoneyVc alloc] init]; //关键语句,必须有 if ([[[UIDevice currentDevice] systemVersion] floatValue]>=8.0) { nextVC.modalPresentationStyle=UIModalPresentationOverCurrentContext; //iOS8以上 }else{ self.modalPresentationStyle = UIModalPresentationCurrentContext; // iOS7平台 } [self.navigationController presentViewController:handMoney animated:YES completion:nil];
// These notifications are sent out after the equivalent delegate message is called //应用已经进入后台 UIKIT_EXTERN NSString *const UIApplicationDidEnterBackgroundNotification NS_AVAILABLE_IOS(4_0); //应用将要进入前台 UIKIT_EXTERN NSString *const UIApplicationWillEnterForegroundNotification NS_AVAILABLE_IOS(4_0); //应用运行成功 UIKIT_EXTERN NSString *const UIApplicationDidFinishLaunchingNotification; UIKIT_EXTERN NSString *const UIApplicationDidBecomeActiveNotification; UIKIT_EXTERN NSString *const UIApplicationWillResignActiveNotification; //收到内存警告 UIKIT_EXTERN NSString *const UIApplicationDidReceiveMemoryWarningNotification;
automaticallyAdjustsScrollViewInsets根据按所在界面的status bar,navigationbar,与tabbar的高度,自动调整scrollview的 inset,设置为no,不让viewController调整,咱们本身修改布局便可。ide
NSValue能够用来存储任意数据类型, 包括数字,结构体等数据类型; NSNumber是NSValue的子类, 是专门用来处理数字的一个类; NSDecimalNumber是NSNumber的子类, 提供了一些基本的算术运算功能.布局
NSDecimal提供的一些类方法:ui
+ (NSDecimalNumber *)zero; + (NSDecimalNumber *)one; + (NSDecimalNumber *)minimumDecimalNumber; + (NSDecimalNumber *)maximumDecimalNumber; + (NSDecimalNumber *)notANumber; - (NSDecimalNumber *)decimalNumberByAdding:(NSDecimalNumber *)decimalNumber; - (NSDecimalNumber *)decimalNumberByAdding:(NSDecimalNumber *)decimalNumber withBehavior:(nullable id <NSDecimalNumberBehaviors>)behavior; - (NSDecimalNumber *)decimalNumberBySubtracting:(NSDecimalNumber *)decimalNumber; - (NSDecimalNumber *)decimalNumberBySubtracting:(NSDecimalNumber *)decimalNumber withBehavior:(nullable id <NSDecimalNumberBehaviors>)behavior; - (NSDecimalNumber *)decimalNumberByMultiplyingBy:(NSDecimalNumber *)decimalNumber; - (NSDecimalNumber *)decimalNumberByMultiplyingBy:(NSDecimalNumber *)decimalNumber withBehavior:(nullable id <NSDecimalNumberBehaviors>)behavior; - (NSDecimalNumber *)decimalNumberByDividingBy:(NSDecimalNumber *)decimalNumber; - (NSDecimalNumber *)decimalNumberByDividingBy:(NSDecimalNumber *)decimalNumber withBehavior:(nullable id <NSDecimalNumberBehaviors>)behavior; - (NSDecimalNumber *)decimalNumberByRaisingToPower:(NSUInteger)power; - (NSDecimalNumber *)decimalNumberByRaisingToPower:(NSUInteger)power withBehavior:(nullable id <NSDecimalNumberBehaviors>)behavior; - (NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(short)power; - (NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(short)power withBehavior:(nullable id <NSDecimalNumberBehaviors>)behavior;
if (self.presentingViewController) { [self dismissViewControllerAnimated:YES completion:nil]; } else { [self.navigationController popViewControllerAnimated:YES]; }
typedef NS_OPTIONS(NSUInteger, UIViewAutoresizing) { UIViewAutoresizingNone = 0, UIViewAutoresizingFlexibleLeftMargin = 1 << 0, UIViewAutoresizingFlexibleWidth = 1 << 1, UIViewAutoresizingFlexibleRightMargin = 1 << 2, UIViewAutoresizingFlexibleTopMargin = 1 << 3, UIViewAutoresizingFlexibleHeight = 1 << 4, UIViewAutoresizingFlexibleBottomMargin = 1 << 5 };
其它的组合相似。atom
摘自:http://www.cnblogs.com/jiangyazhou/archive/2012/06/26/2563041.htmlcode
简单的说, 就是是否会回弹的效果, 相关属性以下所示, 必须bounces为YES时候, 下面的两个属性才有效.htm
@property(nonatomic) BOOL bounces; // default YES. if YES, bounces past edge of content and back again @property(nonatomic) BOOL alwaysBounceVertical; // default NO. if YES and bounces is YES, even if content is smaller than bounds, allow drag vertically @property(nonatomic) BOOL alwaysBounceHorizontal; // default NO. if YES and bounces is YES, even if content is smaller than bounds, allow drag horizontally
以下所示, getter=isAutomaticallyChangeAlpha
, 这样的声明, 若是进行了这样的声明, 那么调用get方法须要调用 isAutomaticallyChangeAlpha
便可. 这么作是为了增长程序的可读性. 从新指定属性的getter或者setter方法blog
@property (assign, nonatomic, getter=isAutomaticallyChangeAlpha) BOOL automaticallyChangeAlpha;
使用:ip
- (void)willMoveToSuperview:(UIView *)newSuperview { [super willMoveToSuperview:newSuperview]; NSLog(@"oldSuperview=%@,newSuperview=%@",self.oldSuperview,newSuperview); self.oldSuperview = newSuperview; NSLog(@"%s",__func__); }
废话很少说, 如下是苹果提供的API:内存
// // UIActivityIndicatorView.h // UIKit // // Copyright (c) 2005-2015 Apple Inc. All rights reserved. // #import <UIKit/UIView.h> #import <UIKit/UIKitDefines.h> NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(NSInteger, UIActivityIndicatorViewStyle) { UIActivityIndicatorViewStyleWhiteLarge, UIActivityIndicatorViewStyleWhite, UIActivityIndicatorViewStyleGray __TVOS_PROHIBITED, }; NS_CLASS_AVAILABLE_IOS(2_0) @interface UIActivityIndicatorView : UIView <NSCoding> - (instancetype)initWithActivityIndicatorStyle:(UIActivityIndicatorViewStyle)style NS_DESIGNATED_INITIALIZER; // sizes the view according to the style - (instancetype)initWithFrame:(CGRect)frame NS_DESIGNATED_INITIALIZER; - (instancetype) initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; @property(nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; // default is UIActivityIndicatorViewStyleWhite @property(nonatomic) BOOL hidesWhenStopped; // default is YES. calls -setHidden when animating gets set to NO @property (nullable, readwrite, nonatomic, strong) UIColor *color NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; - (void)startAnimating; - (void)stopAnimating; - (BOOL)isAnimating; @end NS_ASSUME_NONNULL_END