diff --git a/Sources/Floaty.swift b/Sources/Floaty.swift index 2ae4930..802bbcd 100644 --- a/Sources/Floaty.swift +++ b/Sources/Floaty.swift @@ -568,7 +568,7 @@ open class Floaty: UIView { itemDefaultSet(item) item.titleLabelPosition = titlePosition item.title = title - item.titleView.backgroundColor = itemTitleViewColor + item.titleViewColor = itemTitleViewColor addItem(item: item) return item } @@ -581,7 +581,7 @@ open class Floaty: UIView { let item = FloatyItem() itemDefaultSet(item) item.title = title - item.titleView.backgroundColor = itemTitleViewColor + item.titleViewColor = itemTitleViewColor addItem(item: item) return item } @@ -596,7 +596,7 @@ open class Floaty: UIView { itemDefaultSet(item) item.titleLabelPosition = titlePosition item.title = title - item.titleView.backgroundColor = itemTitleViewColor + item.titleViewColor = itemTitleViewColor item.icon = icon addItem(item: item) return item @@ -610,7 +610,7 @@ open class Floaty: UIView { let item = FloatyItem() itemDefaultSet(item) item.title = title - item.titleView.backgroundColor = itemTitleViewColor + item.titleViewColor = itemTitleViewColor item.icon = icon addItem(item: item) return item @@ -624,7 +624,7 @@ open class Floaty: UIView { let item = FloatyItem() itemDefaultSet(item) item.title = title - item.titleView.backgroundColor = itemTitleViewColor + item.titleViewColor = itemTitleViewColor item.handler = handler addItem(item: item) return item @@ -640,7 +640,7 @@ open class Floaty: UIView { itemDefaultSet(item) item.titleLabelPosition = titlePosition item.title = title - item.titleView.backgroundColor = itemTitleViewColor + item.titleViewColor = itemTitleViewColor item.handler = handler addItem(item: item) return item @@ -654,7 +654,7 @@ open class Floaty: UIView { let item = FloatyItem() itemDefaultSet(item) item.title = title - item.titleView.backgroundColor = itemTitleViewColor + item.titleViewColor = itemTitleViewColor item.icon = icon item.handler = handler addItem(item: item) @@ -671,7 +671,7 @@ open class Floaty: UIView { itemDefaultSet(item) item.titleLabelPosition = titlePosition item.title = title - item.titleView.backgroundColor = itemTitleViewColor + item.titleViewColor = itemTitleViewColor item.icon = icon item.handler = handler addItem(item: item) diff --git a/Sources/FloatyItem.swift b/Sources/FloatyItem.swift index 14427d0..2429b7f 100644 --- a/Sources/FloatyItem.swift +++ b/Sources/FloatyItem.swift @@ -132,13 +132,14 @@ open class FloatyItem: UIView { Title background view */ @objc open var titleView: UIView = UIView() + var titleViewColor: UIColor = .clear /** Item's title. */ @objc open var title: String? = nil { didSet { - let titleViewLeftPadding: CGFloat = 14 + let titleViewLeftPadding: CGFloat = titleViewColor == .clear ? 0 : 14 let titleViewTopPadding: CGFloat = 4 let titleViewCornerRadius: CGFloat = 17