Hide one segment in SegmentControl iOS . swift
Solution:
We had two options with that to achieve.First one is
1.Set the width to 0.Disable the segment to that.
Objective C:
[seg setWidth:0.1 forSegmentAtIndex:1];
[seg setEnabled:NO forSegmentAtIndex:1];
OR
[self.seg removeSegmentAtIndex:0 animated:NO];
Swift:
seg.removeSegment(at: 0, animated: false)
2. Remove the index from the segment Control
We had two options with that to achieve.First one is
1.Set the width to 0.Disable the segment to that.
Objective C:
[seg setWidth:0.1 forSegmentAtIndex:1];
[seg setEnabled:NO forSegmentAtIndex:1];
OR
[self.seg removeSegmentAtIndex:0 animated:NO];
seg.removeSegment(at: 0, animated: false)
Comments
Post a Comment