0

The problem is that I do not get to hide the bar segments. I want to remove because it has only one segment at a given time.

If I delete or hidden the UISegmentedControl, remains a space between the first cell and the navigation bar.

enter image description here

I do not know which of the views, I must change the frame ...

    $3 = 0x0abbdae0 <UIWindow: 0x9f936b0; frame = (0 0; 320 480); layer = <UIWindowLayer: 0x9f9b420>>
   | <UILayoutContainerView: 0xab84630; frame = (0 0; 320 480); autoresize = W+H; layer = <CALayer: 0xab96490>>
   |    | <UITransitionView: 0xab4fe90; frame = (0 0; 320 480); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0xab94600>>
   |    |    | <UIViewControllerWrapperView: 0x9fe23f0; frame = (0 0; 320 480); autoresize = W+H; layer = <CALayer: 0x9fe3170>>
   |    |    |    | <UILayoutContainerView: 0x9fe2c90; frame = (0 0; 320 480); autoresize = W+H; layer = <CALayer: 0x9fb6b00>>
   |    |    |    |    | <UINavigationTransitionView: 0x9fb6870; frame = (0 0; 320 480); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0x9fe39b0>>
   |    |    |    |    |    | <UIViewControllerWrapperView: 0x9f0d530; frame = (0 64; 320 416); autoresize = W+H; layer = <CALayer: 0x9f336d0>>
   |    |    |    |    |    |    | <UITableView: 0xb301800; frame = (0 0; 320 416); clipsToBounds = YES; opaque = NO; autoresize = W+H; gestureRecognizers = <NSArray: 0xabbdc80>; layer = <CALayer: 0xabc06e0>; contentOffset: {0, -0}>
   |    |    |    |    |    |    |    | <UITableViewBackgroundView: 0xabc0e70; frame = (0 0; 320 416); autoresize = W+H; layer = <CALayer: 0xabc0ed0>>
   |    |    |    |    |    |    |    |    | <UIImageView: 0xabc0f00; frame = (0 0; 320 416); opaque = NO; autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0xabc0f60>>
   |    |    |    |    |    |    |    |    | <UIView: 0xabc0fb0; frame = (0 0; 320 416); autoresize = W+H; layer = <CALayer: 0xabc1010>>
   |    |    |    |    |    |    |    | <UITableViewCell: 0x9f3d010; frame = (0 55; 320 46); text = '1'; autoresize = W; layer = <CALayer: 0x9ff9560>>

My setup of visibility:

[self.SegmentControl removeAllSegments];

    if([_invitados count] > 0){
        [self.SegmentControl insertSegmentWithTitle:@"SegmentA" atIndex:0 animated:YES];
    }

    [self.SegmentControl insertSegmentWithTitle:@"SegmentB" atIndex:([self.SegmentControl numberOfSegments]==0 ? 0:1) animated:YES];

    if([_followers count] > 0){
        [self.SegmentControl insertSegmentWithTitle:@"SegmentC" atIndex:[self.SegmentControl numberOfSegments] animated:YES];
    }

    [self.SegmentControl setEnabled:YES forSegmentAtIndex:0];

    if([self.SegmentControl numberOfSegments]<=1){
        [self.SegmentControl removeFromSuperview];
    }
4

1 に答える 1