Skip to content

Commit

Permalink
fix content view frame issue when empty data set is custom
Browse files Browse the repository at this point in the history
  • Loading branch information
hongxinhope committed Apr 6, 2016
1 parent c081116 commit 4f683ba
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.4</string>
<string>1.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5</string>
<string>6</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
2 changes: 1 addition & 1 deletion TBEmptyDataSet.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "TBEmptyDataSet"
s.version = "1.4"
s.version = "1.5"
s.summary = "An extension of UITableView/UICollectionView's super class, it will display a placeholder when the data is empty."

s.homepage = "https://github.com/teambition/TBEmptyDataSet"
Expand Down
3 changes: 1 addition & 2 deletions TBEmptyDataSet/EmptyDataView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class EmptyDataView: UIView {
let contentView = UIView()
contentView.translatesAutoresizingMaskIntoConstraints = false
contentView.backgroundColor = UIColor.clearColor()
contentView.userInteractionEnabled = true
contentView.alpha = 0
return contentView
}()
Expand All @@ -32,7 +31,6 @@ class EmptyDataView: UIView {
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.backgroundColor = UIColor.clearColor()
imageView.contentMode = .ScaleAspectFill
imageView.userInteractionEnabled = false
self.contentView.addSubview(imageView)
return imageView
}()
Expand Down Expand Up @@ -139,6 +137,7 @@ class EmptyDataView: UIView {
contentView.addConstraint(NSLayoutConstraint(item: customView, attribute: .CenterY, relatedBy: .Equal, toItem: contentView, attribute: .CenterY, multiplier: 1, constant: 0))
contentView.addConstraint(NSLayoutConstraint(item: customView, attribute: .Width, relatedBy: .Equal, toItem: .None, attribute: .NotAnAttribute, multiplier: 1, constant: customView.frame.width))
contentView.addConstraint(NSLayoutConstraint(item: customView, attribute: .Height, relatedBy: .Equal, toItem: .None, attribute: .NotAnAttribute, multiplier: 1, constant: customView.frame.height))
contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[\(ViewStrings.customView)]|", options: [], metrics: nil, views: [ViewStrings.customView: customView]))
} else {
var viewStrings = [String]()
var views = [String: UIView]()
Expand Down
2 changes: 1 addition & 1 deletion TBEmptyDataSet/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.4</string>
<string>1.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion TBEmptyDataSet/TBEmptyDataSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ extension UIScrollView: UIGestureRecognizerDelegate {
emptyDataView.backgroundColor = emptyDataSetBackgroundColor()
emptyDataView.hidden = false
emptyDataView.clipsToBounds = true
emptyDataView.userInteractionEnabled = emptyDataSetTapEnabled()
emptyDataView.tapGesture.enabled = emptyDataSetTapEnabled()
scrollEnabled = emptyDataSetScrollEnabled()

emptyDataView.setConstraints()
Expand Down

0 comments on commit 4f683ba

Please sign in to comment.