Skip to content

Commit

Permalink
fix insets
Browse files Browse the repository at this point in the history
  • Loading branch information
emvakar committed Oct 29, 2022
1 parent 2d20e88 commit 994c072
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Sources/EKTabBarController/EKFloatingBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class EKFloatingBarView: UIView {
super.layoutSubviews()

layer.cornerRadius = cornerRadius
_ = addExternalBorder(borderWidth: borderWidth, borderColor: borderColor)
layer.borderColor = borderColor.cgColor
layer.borderWidth = borderWidth

}

Expand All @@ -66,7 +67,7 @@ class EKFloatingBarView: UIView {

addSubview(stackView)
stackView.snp.makeConstraints { make in
make.edges.equalToSuperview().inset(UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16))
make.edges.equalToSuperview().inset(UIEdgeInsets(top: 0, left: abs(16 - borderWidth), bottom: 0, right: abs(16 - borderWidth)))
}

DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
Expand Down
5 changes: 4 additions & 1 deletion Sources/EKTabBarController/EKTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ public final class EKTabBarController: UITabBarController {
borderColor: UIColor = .clear) {

self.controllerItems = controllerItems
self.insets = insets
self.insets = UIEdgeInsets(top: insets.top - borderWidth,
left: insets.left - borderWidth,
bottom: insets.bottom - borderWidth,
right: insets.right - borderWidth)
self.cornerRadius = cornerRadius
self.backColor = backgroundColor
self.bottomSpace = abs(bottomSpace)
Expand Down

0 comments on commit 994c072

Please sign in to comment.