私はあなたの下にお見せしている写真でストーリーボード対シミュレータは何の制約は適用しない
...私は仕事のように多くの時間後に多くの混乱をやっているが、私は何が起こっているのか理解していない可能性が高いことができますストーリーボードlammを参照してください。オレンジの矢印は、私のシミュレータがiPhone SEとIPhone 8 plusの間にiPhone SEで作業していることを示しています。
UIImageViewは、私はストーリーボードのiPhone私に働いているにもかかわらず、すべてのデバイス上で完璧に見えるようにUIImageViewを取るならば、これは助けることができる理由..私は理解していない、その上にグラデーション効果を持っています私? viewDidLoad()
で
gradientMask.frame = _images.bounds;
:
私はまた、あなたのUIImageViewコード
- (void)viewDidLoad {
[super viewDidLoad];
CAGradientLayer *gradientMask = [CAGradientLayer layer];
gradientMask.frame = _images.bounds;
gradientMask.colors = @[(id)[UIColor whiteColor].CGColor,
(id)[UIColor clearColor].CGColor];
_images.layer.mask = gradientMask;
gradientMask.startPoint = CGPointMake(0.8, 0.0);
gradientMask.endPoint = CGPointMake(0.8, 0.8);
gradientMask.colors = @[(id)[UIColor clearColor].CGColor,
(id)[UIColor whiteColor].CGColor,
(id)[UIColor whiteColor].CGColor,
(id)[UIColor clearColor].CGColor];
gradientMask.locations = @[@0.0, @0.0, @0.8, @1.0];
_images.contentMode = UIViewContentModeScaleAspectFill;
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *blur = [[UIVisualEffectView alloc] initWithEffect:effect];
blur.frame = CGRectMake(_images.frame.origin.x, _images.frame.origin.y, _images.frame.size.width, _images.frame.size.height +50);
[_images addSubview:blur];
[UIView animateWithDuration:.1 animations:^{
blur.alpha = .7;
}];
}
あなたも制約を表示する必要がありますが、問題のようです –
ちょうど私またはuちょうど両側にアンカーを配置するのではなく、高さと幅を設定しますか? –
@MilanNosáľ私の投稿を編集しました – kAiN