问题是我无法隐藏条形段。我想删除,因为它在给定时间只有一个段。
如果我删除或隐藏 UISegmentedControl,则在第一个单元格和导航栏之间保留一个空格。
不知道是哪一种观点,我必须改变框架......
$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>>
我的可见性设置:
[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];
}