效果看起來不錯
但有個小問題
就是xcode會有constraint的錯誤,如下
The behavior of the UICollectionViewFlowLayout is not defined because:
the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x7ff06150fde0>, and it is attached to <UICollectionView: 0x7ff06184e800; frame = (0 0; 320 320); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x6000034c83c0>; layer = <CALayer: 0x600003aabbc0>; contentOffset: {53120, 0}; contentSize: {96000, 320.5}; adjustedContentInset: {0, 0, 0, 0}> collection view layout: <UICollectionViewFlowLayout: 0x7ff06150fde0>.
Hi, @LvJianfeng 大大你好 我想請問一下 我做了一個這樣的效果,如附件的影片
影片.zip
效果看起來不錯 但有個小問題 就是xcode會有constraint的錯誤,如下 The behavior of the UICollectionViewFlowLayout is not defined because: the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values. The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x7ff06150fde0>, and it is attached to <UICollectionView: 0x7ff06184e800; frame = (0 0; 320 320); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x6000034c83c0>; layer = <CALayer: 0x600003aabbc0>; contentOffset: {53120, 0}; contentSize: {96000, 320.5}; adjustedContentInset: {0, 0, 0, 0}> collection view layout: <UICollectionViewFlowLayout: 0x7ff06150fde0>.
而且當下拉時,自動輪播到下一張圖片時,圖片的位置好像會偏移 在影片中可以觀察到下拉後圖片右側會顯示一點點下一張的圖
下拉放大效果的作法我是參照 http://blog.matthewcheok.com/design-teardown-stretchy-headers/
不知道這個問題是否有解呢? 如果需要源碼可以跟我說,我再傳給您參考 麻煩您了,謝謝