我试图以这种方式注册本地通知的应用程序:
UIApplication.sharedApplication().registerUserNotificationSettings(UIUserNotificationSettings(forTypes: UIUserNotificationType.Alert | UIUserNotificationType.Badge, categories: nil))
Run Code Online (Sandbox Code Playgroud)
在Xcode 7和Swift 2.0中 - 我收到错误Binary Operator "|" cannot be applied to two UIUserNotificationType operands.请帮我.
我在使用addSubview时遇到问题.
示例代码:
ParentView *myParentView = [[ParentView alloc] initWithNibName:@"ParentView " bundle:nil];
ChildeView *myChildeView = [[ChildeView alloc] initWithNibName:@"ChildeView" bundle:nil];
//... parent frame resized with setFrame lets say to x:0, y:0, W:320, H:411
[[myParentView view] addSubview: [myChildeView view]];
Run Code Online (Sandbox Code Playgroud)
我的孩子在添加时比父母大,并且不会将其框架调整为父边界.我不能在父级上使用"剪辑子视图",如果父级框架未再次调整大小,则"自动调整子视图"似乎不起作用.是否有一个属性使子视图自动调整大小到其父级边界,而不对每个子节点使用setFrame?