Skip to content

Commit

Permalink
Fixed translucent searchBar Bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
YuigaWada committed Aug 31, 2019
1 parent 3be3072 commit 9ccbe16
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion PolioPager.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "PolioPager"
s.version = "2.0"
s.version = "2.0.1"
s.summary = "PolioPager enables us to use PagerTabStrip like SNKRS."
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.homepage = "https://github.com/yuigawada/PolioPager"
Expand Down
4 changes: 4 additions & 0 deletions PolioPager/PageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ public class PageViewController: UIPageViewController, UIScrollViewDelegate {
collectionViewはUserInteractionを認識しません。
したがって、searchBarとcollectionViewのisUserInteractionEnabledを入れ替える必要があります。
(正直な話、UIViewPropertyAnimatorの適切な使い方がわからないだけです)


(追記)
SearchBarとcollectionViewの重なり順を逆転させました。
*/


Expand Down
2 changes: 2 additions & 0 deletions PolioPager/PolioPagerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ open class PolioPagerViewController: UIViewController, TabCellDelegate, PolioPag

}.forEach{$0.alpha = alpha}

self.collectionView.backgroundColor = alpha == 1 ? .white : .clear

self.selectedBar.alpha = alpha
}

Expand Down
30 changes: 15 additions & 15 deletions PolioPager/PolioPagerViewController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,6 @@
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Wzf-PR-459">
<rect key="frame" x="0.0" y="83" width="414" height="813"/>
</containerView>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="aU5-VK-ObC">
<rect key="frame" x="0.0" y="44" width="414" height="35"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="10" minimumInteritemSpacing="10" id="QoS-za-uQQ">
<size key="itemSize" width="50" height="50"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<cells/>
<connections>
<outlet property="dataSource" destination="-1" id="mwf-Ab-pcl"/>
<outlet property="delegate" destination="-1" id="AWp-Y6-iMR"/>
</connections>
</collectionView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ypc-Nb-c7o">
<rect key="frame" x="53" y="44" width="361" height="35"/>
<subviews>
Expand Down Expand Up @@ -74,6 +59,21 @@
<constraint firstItem="xVK-Lg-LpH" firstAttribute="leading" secondItem="ypc-Nb-c7o" secondAttribute="leading" id="wfz-qO-nGo"/>
</constraints>
</view>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="aU5-VK-ObC">
<rect key="frame" x="0.0" y="44" width="414" height="35"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="10" minimumInteritemSpacing="10" id="QoS-za-uQQ">
<size key="itemSize" width="50" height="50"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<cells/>
<connections>
<outlet property="dataSource" destination="-1" id="mwf-Ab-pcl"/>
<outlet property="delegate" destination="-1" id="AWp-Y6-iMR"/>
</connections>
</collectionView>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="CvP-VG-H8J">
<rect key="frame" x="0.0" y="88" width="253" height="3"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
Expand Down

0 comments on commit 9ccbe16

Please sign in to comment.