ermalkaleci / CarbonKit

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

Carbon segment control text hides under indicator #237

Open O-mkar opened 5 years ago

O-mkar commented 5 years ago

I i have modified indicator height and it seems to work fine but the indicator overlaps the title, looks like a bug

How it looks

27C6F167-12F5-4BC9-BF6C-8EAF282E60EF

But when i over scroll on right it fixes

B39A0712-1E15-47FB-ACCF-5BA3F7201AB6

Here is a video link https://youtu.be/eGCbbcT6ki4

Any idea what willl be the issue?

O-mkar commented 5 years ago

i fixed it by using zPosition, i'm not sure if it is the right way to do it.

- (void)syncImageTintColor {
    for (UIView *segment in self.segments) {

        for (UIView *subView in segment.subviews) {
            if ([subView isKindOfClass:[UIImageView class]]) {
                if ([self.segments indexOfObject:segment] == self.selectedSegmentIndex) {
                    subView.tintColor = _imageSelectedColor;
                    self.indicator.layer.zPosition = -1; //here

                } else {
                    subView.tintColor = _imageNormalColor;

                }
            }

        }

    }
}
Jony-Ive-1993 commented 4 years ago

just add one line in pod file : - CarbonTabSwipeNavigation.m

self.carbonSegmentedControl.indicator.layer.zPosition = -1;