0
UITextViewの背後にUIButtonを挿入するのに問題があります。私はボタンを作ることができますし、それは仕事をうまくやっていますが、私が何をしても、それは常にtextViewの前に描画されます。UIButtonビューの背景
- (void)textViewDidBeginEditing:(UITextView *)textView
{
self.backgroundButton = [[UIButton alloc] initWithFrame:self.view.frame];
[self.backgroundButton addTarget:textView action:@selector(resignFirstResponder) forControlEvents:UIControlEventTouchDown];
[self.view insertSubview:self.backgroundButton aboveSubview:textView];
[self.view bringSubviewToFront:textView];
}
はまだ動作しません。 :(ボタンはテキストビューの上に描画されます。 を追加すると[self.backgroundButton setBackgroundColor:[UIColor blueColor]]; が表示されます –