UIViewAutoresizingFlexibleWidth

2017-01-17  本文已影响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;

}

上一篇 下一篇

猜你喜欢

热点阅读