Skip to content

Commit

Permalink
XM Changes for unselected cell background color
Browse files Browse the repository at this point in the history
  • Loading branch information
xmdev committed Jul 27, 2018
1 parent 1619ad4 commit 135b4bd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ DerivedData
*.perspectivev3
!default.perspectivev3
xcuserdata
XLPagerTabStrip.xcworkspace/xcshareddata/

## Other
*.xccheckout
Expand Down Expand Up @@ -51,4 +52,4 @@ playground.xcworkspace

Carthage/Build

.swift-version
.swift-version
2 changes: 2 additions & 0 deletions Sources/ButtonBarPagerTabStripViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public struct ButtonBarPagerTabStripSettings {
public var buttonBarItemFont = UIFont.systemFont(ofSize: 18)
public var buttonBarItemLeftRightMargin: CGFloat = 8
public var buttonBarItemTitleColor: UIColor?
public var buttonBarItemUnselectedColor: UIColor?
@available(*, deprecated: 7.0.0) public var buttonBarItemsShouldFillAvailiableWidth: Bool {
set {
buttonBarItemsShouldFillAvailableWidth = newValue
Expand Down Expand Up @@ -329,6 +330,7 @@ open class ButtonBarPagerTabStripViewController: PagerTabStripViewController, Pa
cell.label.textColor = settings.style.buttonBarItemTitleColor ?? cell.label.textColor
cell.contentView.backgroundColor = settings.style.buttonBarItemBackgroundColor ?? cell.contentView.backgroundColor
cell.backgroundColor = settings.style.buttonBarItemBackgroundColor ?? cell.backgroundColor
cell.unselectedBottomView.backgroundColor = settings.style.buttonBarItemUnselectedColor ?? cell.backgroundColor
if let image = indicatorInfo.image {
cell.imageView.image = image
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/ButtonBarViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ open class ButtonBarViewCell: UICollectionViewCell {

@IBOutlet open var imageView: UIImageView!
@IBOutlet open var label: UILabel!

@IBOutlet weak var unselectedBottomView: UIView!
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)

Expand Down
27 changes: 19 additions & 8 deletions Sources/ButtonCell.xib
Original file line number Diff line number Diff line change
@@ -1,50 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="zg4-fX-zUF" customClass="ButtonBarViewCell" customModule="XLPagerTabStrip" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="80" height="40"/>
<rect key="frame" x="0.0" y="0.0" width="80" height="46"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="80" height="40"/>
<rect key="frame" x="0.0" y="0.0" width="80" height="46"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="s7f-rk-sQl">
<rect key="frame" x="22" y="12" width="37.5" height="17"/>
<rect key="frame" x="21" y="15" width="38" height="17"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="tFG-yJ-6Th">
<rect key="frame" x="22.5" y="2.5" width="35" height="35"/>
<rect key="frame" x="23" y="3" width="35" height="35"/>
<constraints>
<constraint firstAttribute="width" constant="35" id="VRw-5F-5WY"/>
<constraint firstAttribute="height" constant="35" id="ojk-Ug-Lgh"/>
</constraints>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jAQ-uB-h0L">
<rect key="frame" x="0.0" y="40" width="80" height="6"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
</subviews>
</view>
<color key="backgroundColor" red="0.027450980390000001" green="0.72549019609999998" blue="0.60784313729999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="tFG-yJ-6Th" firstAttribute="centerY" secondItem="zg4-fX-zUF" secondAttribute="centerY" id="5so-ZP-gRs"/>
<constraint firstItem="jAQ-uB-h0L" firstAttribute="centerX" secondItem="zg4-fX-zUF" secondAttribute="centerX" id="5LY-G2-lZ5"/>
<constraint firstItem="tFG-yJ-6Th" firstAttribute="centerY" secondItem="zg4-fX-zUF" secondAttribute="centerY" constant="-2.5" id="5so-ZP-gRs"/>
<constraint firstItem="tFG-yJ-6Th" firstAttribute="centerX" secondItem="zg4-fX-zUF" secondAttribute="centerX" id="9em-NR-hoa"/>
<constraint firstAttribute="bottom" secondItem="jAQ-uB-h0L" secondAttribute="bottom" id="E3L-ej-WkA"/>
<constraint firstAttribute="trailing" secondItem="jAQ-uB-h0L" secondAttribute="trailing" id="Roo-xL-cj7"/>
<constraint firstItem="s7f-rk-sQl" firstAttribute="centerY" secondItem="zg4-fX-zUF" secondAttribute="centerY" id="ZeP-6I-AXE"/>
<constraint firstItem="s7f-rk-sQl" firstAttribute="centerX" secondItem="zg4-fX-zUF" secondAttribute="centerX" id="c15-bZ-hPG"/>
<constraint firstItem="jAQ-uB-h0L" firstAttribute="top" secondItem="s7f-rk-sQl" secondAttribute="bottom" constant="8" symbolic="YES" id="xUU-ZB-2jf"/>
<constraint firstItem="jAQ-uB-h0L" firstAttribute="leading" secondItem="zg4-fX-zUF" secondAttribute="leading" id="xc3-B0-YMc"/>
</constraints>
<size key="customSize" width="80" height="46"/>
<connections>
<outlet property="imageView" destination="tFG-yJ-6Th" id="Odb-dR-tf4"/>
<outlet property="label" destination="s7f-rk-sQl" id="4gU-tb-BMB"/>
<outlet property="unselectedBottomView" destination="jAQ-uB-h0L" id="9WV-kC-pFY"/>
</connections>
<point key="canvasLocation" x="307" y="541"/>
<point key="canvasLocation" x="307" y="544"/>
</collectionViewCell>
</objects>
</document>

0 comments on commit 135b4bd

Please sign in to comment.