1
覗き見とポップの表示ヒント(押されたビューが鮮明に残り、他のすべてがぼかし始めている瞬間)、私は鋭い非長方形...台形、正確であること。これを達成する方法は?Peek and Pop 3Dタッチ - 非矩形プレビューコンテキストプレゼンテーション
3Dタッチの実装では、我々はすべて我々が鉱山は次のようになります方法で
をpreviewingContextのsourceRectプロパティを設定することを知っている:
- (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext viewControllerForLocation:(CGPoint)location {
if (CGRectContainsPoint(self.particularView.frame, location)) {
previewingContext.sourceRect = self.particularView.frame;
MyCustomViewController *customVC = [[MyCustomViewController customInit];
customVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
customVC.preferredContentSize = self.view.frame.size;
return customVC;
}
return nil;
}
すべてが想像全くとして、働きます。しかし私はpreviewContext.sourceRectの広がりが鋭いままであることを望んでいません!私はコーナーを切って、台形を鋭いままにしたい。誰にでも解決策がありますか?
をお試しください –