drawRect / Instagram_Stories

Inspired by Instagram Stories functionality. This source is similar to Instagram Stories, which is having both image and video support.
MIT License
414 stars 76 forks source link

Seems image and Video(If Portrait) not displaying full screen #102

Closed ramanocs1145 closed 4 years ago

ramanocs1145 commented 4 years ago

Describe the bug I can able to see full frame for IGStoryPreViewView and UICollectionView when I change constraint like below,

        NSLayoutConstraint.activate([
            self.leftAnchor.constraint(equalTo: snapsCollectionView.leftAnchor),
            self.topAnchor.constraint(equalTo: snapsCollectionView.topAnchor),
            snapsCollectionView.rightAnchor.constraint(equalTo: self.rightAnchor),
            snapsCollectionView.bottomAnchor.constraint(equalTo: self.bottomAnchor)])

But Seems In IGStoryPreViewCell Y position having 39 instead of 0

To Reproduce Make build on iPhone 11 Pro Max simulator or device.

Expected behavior Should have full screen based on IGStoryPreViewView

Screenshots HierarchyFullview HierarchyForIGStoryPreViewCell

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context FYI: I have tested your source on iOS 13.5, so I have added cv.contentInsetAdjustmentBehavior = .never on IGStoryPreviewView collectionView, cause automaticallyAdjustsScrollViewInsets is depreciated in iOS 11 automaticallyAdjustsScrollViewInsets = false

In IGStoryPreviewController class I can't see any constraint related code for IGStoryPreviewView? How get it frame on there? AnimatedCollectionViewLayout manage and handle snapsCollectionView super view frame on IGStoryPreviewView class?

Kindly suggest me to make full screen and the above clarifications.

ranmyfriend commented 4 years ago

@ramanocs1145 We will check and update you :)

ramanocs1145 commented 4 years ago

@ranmyfriend & @boominadhaprakash ,

It's fixed. I just return like return CGSize(width: _view.snapsCollectionView.frame.width, height: _view.snapsCollectionView.frame.height) even our required Deployment target from iOS 11.0 on sizeForItemAt from UICollectionViewDelegateFlowLayout at StoryPreViewViewController

Thanks for giving this wonderful library for to support Instagram Stories for custom implementation.

ranmyfriend commented 4 years ago

You are great. Thanks for your support.