There should probably be new discussion forums for IGSlideTabView and IGFlowLayoutView.
Ah, "hid" ... good lord. Can you tell I've been doing art mockups for a week instead of coding?
I believe iOS standard naming would probably dictate "didHide."
My earlier post said something like, "Awaiting moderation." I don't know where it went...
Hi Caylan,
I do not see your slide tab post as of yet, in the meantime I'll try to answer some of the questions you've had in this last post.
The slide tab control allows for full control over position and offset, which can up its complexity and therefore requires the possibility of using math for tab placement. To better support all possible design use cases, we didn't include leading/centered/trailing alignments to provide the ability to fine tune the tab position against the content.
Your 1st Edit
slideTabView:tabHid: is called after the tab has hid its content. Past tense version of hide, because it has already occurred.
Your 2nd Edit
The sample browser uses this same code, except it uses a hard code value that is half of the tab height or width depending on which side of the screen it resides. We can update this in a future release to improve readability.
Btw, since I can't access that other post, the SE_ prefix methods are from the "Constraint Pack" dir you can find in another one of my auto layout enabled projects. I admit that this is a small issue, since we are swapping only two lines of code. I just expect it to work because I instinctually gut autoresizingMask in my projects. e.g. code smell.
My first impressions of the IGSlideTabItem is that there should be an easier way to align the tab within the frame. The location has 4 choices, but an alignment of leading/center/trailing would be nice as to avoid the math and magic numbers in offset/position.
Nice work, iOS team.
Edit: Seeing a possible typo in delegate: -(void)slideTabView:(IGSlideTabView *)slideTabView tabHid:(IGSlideTabItem *)tabHid. Should probably be tabHide.
Edit 2: Here's an updated delegate to center the tab and content without magic numbers.
- (void)slideTabView:(IGSlideTabView *)slideTabView tabContentSizeChanged:(IGSlideTabItem *)tab
{
if (tab.tabLocation == IGSlideTabLocationTop || tab.tabLocation == IGSlideTabLocationBottom)
tab.tabOffset = CGPointMake(tab.actualContentSize.width / 2 - (tab.tabSize.width / 2), 0);
tab.tabPosition = (slideTabView.bounds.size.width / 2) - tab.tabOffset.x;
tab.tabPosition -= tab.tabSize.width / 2;
}
else
tab.tabOffset = CGPointMake(0, tab.actualContentSize.height / 2 - (tab.tabSize.height / 2));
tab.tabPosition = (slideTabView.bounds.size.height / 2) - tab.tabOffset.y;
tab.tabPosition -= tab.tabSize.height / 2;
I just posted another thread about IGSlideTabView crasher and the forum software moderated me. Just an FYI... I'm not spam. Promise.