Implemented find on page UI
This commit is contained in:
@@ -9,6 +9,8 @@ import UIKit
|
||||
|
||||
class ReliefButton: UIButton
|
||||
{
|
||||
public var constrainedToSquare = true
|
||||
|
||||
internal let shadowView = UIView(frame: .zero)
|
||||
internal let backgroundView = GradientView(direction: .vertical, colors: ReliefButton.gradientColors(inverted: false, darkMode: false))
|
||||
|
||||
@@ -140,9 +142,14 @@ class ReliefButton: UIButton
|
||||
sendSubviewToBack(backgroundView)
|
||||
sendSubviewToBack(shadowView)
|
||||
|
||||
let backgroundDimension = bounds.height
|
||||
backgroundView.frame = CGRect(origin: .zero, size: CGSize(width: backgroundDimension, height: backgroundDimension))
|
||||
backgroundView.frame = backgroundView.frame.centeredX(inRect: bounds)
|
||||
if constrainedToSquare {
|
||||
let backgroundDimension = bounds.height
|
||||
backgroundView.frame = CGRect(origin: .zero, size: CGSize(width: backgroundDimension, height: backgroundDimension))
|
||||
backgroundView.frame = backgroundView.frame.centeredX(inRect: bounds)
|
||||
} else {
|
||||
backgroundView.frame = bounds
|
||||
}
|
||||
|
||||
shadowView.frame = backgroundView.frame
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user