ermalkaleci / CarbonKit

CarbonKit - iOS Components (Obj-C & Swift)
MIT License
682 stars 164 forks source link

Add a mask when tab changes #256

Open rockylive opened 4 years ago

rockylive commented 4 years ago

PHOTO-2020-05-19-19-32-27

Please add this feature where you switching from tabs

eddyteddy3 commented 3 years ago

I had the same query and i did a hack there to achieve that.

I set the indicator height with the height of segmentControl then gave the desired background color to indicator and then gave the cornerRadius to indicator as they are using image for the indicator.

    tabSwipe.setIndicatorColor(.black) //indicator color
    tabSwipe.carbonTabSwipeScrollView.isScrollEnabled = false //set accordingly 
    tabSwipe.setIndicatorHeight(39) //perfect for my scenario
    tabSwipe.carbonTabSwipeScrollView.backgroundColor = UIColor(named: "Dark") //segment background color
    tabSwipe.carbonSegmentedControl?.indicator.layer.cornerRadius = 10 //desired  radius