yysskk / SwipeMenuViewController

Swipable tab and menu View and ViewController.
MIT License
1.29k stars 131 forks source link

Change the underline color and the selected text ? #59

Closed Terens777 closed 6 years ago

Terens777 commented 6 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

Terens777 commented 6 years ago

How to change the underscore color and the selected text, after swipe or selected tab?

   override func swipeMenuView(_ swipeMenuView: SwipeMenuView, willChangeIndexFrom fromIndex: Int, to toIndex: Int) {
        super.swipeMenuView(swipeMenuView, willChangeIndexFrom: fromIndex, to: toIndex)
        switch toIndex {
        case 0:
            swipeMenuView.options.tabView.itemView.selectedTextColor = const.strategiSelectItemTextColor
            swipeMenuView.options.tabView.additionView.backgroundColor = const.strategiSelectItemTextColor
        case 1:
            swipeMenuView.options.tabView.itemView.selectedTextColor = const.tradeIdeasSelectetItemTextColor
            swipeMenuView.options.tabView.additionView.backgroundColor = const.tradeIdeasUnderLineColor
        case 2:
            swipeMenuView.options.tabView.itemView.selectedTextColor = const.strategiSelectItemTextColor
            swipeMenuView.options.tabView.additionView.backgroundColor = const.strategiSelectItemTextColor
        default:
           break
        }
        swipeMenuView.reloadData(options: swipeMenuView.options, default: toIndex)
    }
Terens777 commented 6 years ago

In this way, after a few clicks on taboos or several svaypov begins to work incorrectly

2018-09-10 17 38 25

Terens777 commented 6 years ago

can be some kind of solution who has already encountered such an idea?

Terens777 commented 6 years ago

maybe error in reloadData?

Terens777 commented 6 years ago

I used the wrong method The solution works in this way

swipeMenuView.tabView?.reloadData(options: swipeMenuView.options.tabView)