Skip to content

Commit f75c0a2

Browse files
committed
Fixed layout for NativePlaceholderView.
1 parent 85848d3 commit f75c0a2

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

NativeUIKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = 'NativeUIKit'
4-
s.version = '1.1.4'
4+
s.version = '1.1.5'
55
s.summary = 'Mimicrated views and controls to native Apple appearance.'
66
s.homepage = 'https://github.com/ivanvorobei/NativeUIKit'
77
s.source = { :git => 'https://github.com/ivanvorobei/NativeUIKit.git', :tag => s.version }

Sources/NativeUIKit/Views/NativePlaceholderView.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,15 @@ open class NativePlaceholderView: SPButton {
125125
let width = min(superview.readableWidth, NativeLayout.Sizes.actionable_area_maximum_width)
126126
setWidthAndFit(width: width)
127127
setXCenter()
128-
center.y = (superview.frame.height / 2) * 0.94
128+
switch superview {
129+
case _ as UICollectionView:
130+
center.y = (superview.layoutHeight / 2) * 0.94
131+
case _ as UITableView:
132+
center.y = (superview.layoutHeight / 2) * 0.94
133+
default:
134+
center.y = (superview.frame.height / 2) * 0.94
135+
}
136+
129137
}
130138

131139
open override func layoutSubviews() {

0 commit comments

Comments
 (0)