//autolayout给XIB创建的View固定位置
- (void)addSubview:(UIView*)viewwithInsets:(UIEdgeInsets)insets{
[selfaddSubview:view];
view.translatesAutoresizingMaskIntoConstraints = NO;
NSArray*consHArr = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(a)-[view]-(b)-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:@{@"a": @(insets.left),@"b": @(insets.right)} views:@{@"view": view}];
[selfaddConstraints:consHArr];
NSArray*consVArr = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(a)-[view]-(b)-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:@{@"a": @(insets.top),@"b": @(insets.bottom)} views:@{@"view": view}];
[selfaddConstraints:consVArr];
}