如何在APP extension 中使用PureLayout
1个回答
展开全部
#import "PureLayout.h"
#import
........
.........
(instancetype)init
{
self = [super init];
NSLog(@"-----EmojiKeyboardView: init------");
// layout bottom group, align parent bottom, height 40;
self.bottomGroup = [[UIView alloc] init];
self.bottomGroup.translatesAutoresizingMaskIntoConstraints = NO;
self.bottomGroup.backgroundColor = [UIColor blueColor];
[self addSubview:self.bottomGroup];
}
....
....
(void) updateConstraints
{
if (!self.didSetupConstraints) {
[self.bottomGroup autoCenterInSuperview];
self.didSetupConstraints = YES;
}
[super updateConstraints];
}
keyboard extension crash and report:
'NSInvalidArgumentException', reason: '-[UIView autoCenterInSuperview]: unrecognized selector sent to instance 0x147e2dd10'
#import
........
.........
(instancetype)init
{
self = [super init];
NSLog(@"-----EmojiKeyboardView: init------");
// layout bottom group, align parent bottom, height 40;
self.bottomGroup = [[UIView alloc] init];
self.bottomGroup.translatesAutoresizingMaskIntoConstraints = NO;
self.bottomGroup.backgroundColor = [UIColor blueColor];
[self addSubview:self.bottomGroup];
}
....
....
(void) updateConstraints
{
if (!self.didSetupConstraints) {
[self.bottomGroup autoCenterInSuperview];
self.didSetupConstraints = YES;
}
[super updateConstraints];
}
keyboard extension crash and report:
'NSInvalidArgumentException', reason: '-[UIView autoCenterInSuperview]: unrecognized selector sent to instance 0x147e2dd10'
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询