hi,
is there a way to make all slide tab's content area to start at specific Y position and be the same height?
Thanks
Mark
please ignore my question. contentsize is what i needed ;!)
no, that did not work for me.
So my question is - is there a way that all my tabs slide in with the same size and position.
The code below is doing the first tab as I want but the second tab starts below the first one and I want it to start just like the first one.
Possible?
Thank you
@interface SlideTabContent () <IGSlideTabDelegate>
{
IGSlideTabView *_slideTabView;
IGSlideTabItem *_tabItemRight,*_tabItemRight2;
IGLabel *_label;
UIView *_contentViewRight,*_contentViewRight2;
}
@end
@implementation SlideTabContent
- (void)viewDidLoad
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
[self createTabContentViews];
_slideTabView = [[IGSlideTabView alloc] initWithFrame:self.view.bounds];
_slideTabView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
_slideTabView.useTabPadding = YES;
_slideTabView.delegate = self;
[self.view addSubview:_slideTabView];
_tabItemRight = [[IGSlideTabItem alloc] init];
_tabItemRight.tabLocation = IGSlideTabLocationRight;
_tabItemRight.title = NSLocalizedString(@"Right1", @"Right1");
_tabItemRight.contentSize = [IGSlideTabContentSize sizeWithPercentageWidth: 0.4 percentageHeight:1];
_tabItemRight.contentView = _contentViewRight;
_tabItemRight.tabPosition = 0;
[_slideTabView addTab:_tabItemRight];
_tabItemRight2 = [[IGSlideTabItem alloc] init];
_tabItemRight2.tabLocation = IGSlideTabLocationRight;
_tabItemRight2.title = NSLocalizedString(@"Right2", @"Right2");
_tabItemRight2.contentSize = [IGSlideTabContentSize sizeWithPercentageWidth: 0.4 percentageHeight:1];
_tabItemRight2.contentView = _contentViewRight2;
_tabItemRight2.tabPosition = 160;
[_slideTabView addTab:_tabItemRight2];
- (void)createTabContentViews
UIColor *contentBackgroundColor = [UIColor whiteColor];
UIColor *tabBorderColor = [UIColor colorWithWhite:0.77 alpha:1.0];
CGFloat tabBorderWidth = 3;
_contentViewRight = [[UIView alloc] init];
_contentViewRight.backgroundColor = contentBackgroundColor;
_contentViewRight.layer.borderWidth = tabBorderWidth;
_contentViewRight.layer.borderColor = tabBorderColor.CGColor;
_contentViewRight2 = [[UIView alloc] init];
_contentViewRight2.backgroundColor = contentBackgroundColor;
_contentViewRight2.layer.borderWidth = tabBorderWidth;
_contentViewRight2.layer.borderColor = tabBorderColor.CGColor;
When you're using a tab item on the left or right side of the view, setting the tabPosition will adjust the Y position of the tab, so for example if you want both at the top, set tabPosition to 0. To make the 2nd tab that was originally at Y 160, you can use the tabOffset property found on the tab item to set the Y position to 160 (X would be 0).
If this doesn't answer your question, give me a little more detail about what you want to do.
Torrey,
i thought tabPosition controls actual tab position, I need the actual tab content view to come out the same way from the right or left starting at the same position. So by changing tabPosition to be say at 0, all tabs are going to be on top of each other. Is there a way to control the position of tab content view?
Sorry. I misread your post. All works as you described.