Todo リスト アプリケーションのスワイプ機能を作成しています。ユーザーがセルを水平方向にスワイプ (ドラッグ) すると、画面の端とセルの端の間の隙間を覆う背景画像を表示したいと思います。
imageView-property に画像を追加すると、セルに追従します。背景全体をカバーするように修正できますか?
Clearのようなものを作りたいようです。
あなたがする必要があるのは次のとおりです。
UITableViewCell
このように画像ビューを追加します..
UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.bounds];
imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
imageView.image = myImage;
[self insertSubview:imageView atIndex:0]; //I'm not at a compiler, so I'm not 100% on this, but it's something like this.
を追加しUIGestureRecognizer
てジェスチャを処理し、ドラッグと適切なアクションを設定します。