美文网首页
UIViewAutoresizingFlexibleWidth

UIViewAutoresizingFlexibleWidth

作者: 石玉龙 | 来源:发表于2017-01-17 21:53 被阅读207次

UIViewAutoresizingNone

不会随父视图的改变而改变

UIViewAutoresizingFlexibleLeftMargin

自动调整view与父视图左边距,以保证右边距不变

UIViewAutoresizingFlexibleWidth

自动调整view的宽度,保证左边距和右边距不变

UIViewAutoresizingFlexibleRightMargin

自动调整view与父视图右边距,以保证左边距不变

UIViewAutoresizingFlexibleTopMargin

自动调整view与父视图上边距,以保证下边距不变

UIViewAutoresizingFlexibleHeight

自动调整view的高度,以保证上边距和下边距不变

UIViewAutoresizingFlexibleBottomMargin

自动调整view与父视图的下边距,以保证上边距不变

-(void)configureViews

{

self.userInteractionEnabled = NO;

self.autoresizingMask = UIViewAutoresizingFlexibleWidth;

_progressBarView = [[UIView alloc] initWithFrame:self.bounds];

_progressBarView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;

UIColor *tintColor = [UIColor colorWithRed:22.f / 255.f green:126.f / 255.f blue:251.f / 255.f alpha:1.0]; // iOS7 Safari bar color

if ([UIApplication.sharedApplication.delegate.window respondsToSelector:@selector(setTintColor:)] && UIApplication.sharedApplication.delegate.window.tintColor) {

tintColor = UIApplication.sharedApplication.delegate.window.tintColor;

}

_progressBarView.backgroundColor = tintColor;

[self addSubview:_progressBarView];

_barAnimationDuration = 0.27f;

_fadeAnimationDuration = 0.27f;

_fadeOutDelay = 0.1f;

}

相关文章

网友评论

      本文标题:UIViewAutoresizingFlexibleWidth

      本文链接:https://www.haomeiwen.com/subject/vqcvbttx.html