3

私のストーリーボードでは、タップ アイコンを として追加しましたUIImageView。コードでは、サークル ビューを作成し、それらを拡大およびフェードすることで、それを脈動させ、「波紋」効果を追加します。これらの円ビューを で追加しviewDidLoadましinsertSubview:belowSubview:たが、何らかの理由でまだ上に表示されます。どうしてこれなの?

私が使用しているコードは次のとおりです。

// For the tap animation at the top
UIView *topTapRipple1 = [[UIView alloc] initWithFrame:(CGRectMake(157, 50, 13.0, 13.0))];
topTapRipple1.backgroundColor = [UIColor clearColor];
topTapRipple1.layer.cornerRadius = topTapRipple1.bounds.size.height/2;
topTapRipple1.layer.borderColor = [UIColor colorWithRed:0.886 green:0.886 blue:0.886 alpha:1].CGColor;
topTapRipple1.layer.borderWidth = 1.0;
[self.view insertSubview:topTapRipple1 belowSubview:self.middle];

UIView *topTapRipple2 = [[UIView alloc] initWithFrame:(CGRectMake(157, 50, 13.0, 13.0))];
topTapRipple2.backgroundColor = [UIColor clearColor];
topTapRipple2.layer.cornerRadius = topTapRipple2.bounds.size.height/2;
topTapRipple2.layer.borderColor = [UIColor colorWithRed:0.886 green:0.886 blue:0.886 alpha:1].CGColor;
topTapRipple2.layer.borderWidth = 1.0;
[self.view insertSubview:topTapRipple2 belowSubview:self.middle];

ご覧のとおり、ビューの下にself.middleビューを追加しますUImageView

波紋が後ろから始まるようにしたいのですが、それでも次のようになります。

ここに画像の説明を入力

画像が次のようになっている場合、画像の上に円が表示されます。

ここに画像の説明を入力

問題を含むサンプル プロジェクト: http://cl.ly/2v2G053t3t0z

4

1 に答える 1