Closed tsomaev closed 4 years ago
@msaps
@Tawfikk what color property are you wanting to change? Note that customize()
is not called when the bar position updates so your switch statement would only ever execute on the initial pass and set the properties according to the state at that time.
Also apologies for the slow response!
I want to update color for background color on pager buttons.
Like this
Hello @msaps and thank you for this library!
I have to implement the same logic, the background of TMBarButton
has to change when it is selected. You confirm that it's not possible currently, we can just customize the tintColor
with selectedTintColor
and tintColor
? Maybe we can send you a PR to add 2 properties: backgroundColor
and selectedBackgroundColor
? Or just create our own TMBarButton subclass ? Thank you
Hi @msaps, First of all, thank you for the wonderful library. I do have the same question as above.
Hi @Tawfikk , Did u manage to alcomplish it?
@Gurungboi no, this no actually for me. I solved my problem by using other library
@Tawfikk i am still trying but which library are you using?
@Tawfikk I manage to change its state using pageboyViewController.
WHY don't you write how to resolve it?
I waste a lot of time.
not need PageboyViewController
I wrote it
class TabPagerButton: Tabman.TMLabelBarButton {
override func update(for selectionState: TMBarButton.SelectionState) {
switch selectionState {
case .selected:
backgroundColor = .red
default:
backgroundColor = .clear
}
super.update(for: selectionState)
}
}
and replaced TMLabelBarButton
to TabPagerButton
let barView = TMBarView<TMHorizontalBarLayout, TabPagerButton, TMBarIndicator.None>()
This my code for bar configure, but when I tapped button, color not change. What am I doing wrong ?