2014-11-06 14 views
0

https://github.com/EuanChan/XSlidableTabController 從那裏我下載一個演示滑動tabbar,但在這個演示我想tabbar位置一點點下來,因爲我想設置一個圖像,標籤和返回按鈕的頁面頂部,但我能不能找到設置的TabBar位置, 和我隱藏導航欄及其對機頂盒自動,我想有點下來如何設置滑動tabbar y位置播種

-(void)viewWillAppear:(BOOL)animated { 

    self.navigationController.navigationBarHidden = YES; 
} 

enter image description here

,但我想設置的TabBar 的圖像頂部請幫助我,請分享你的val uable知識

回答

0

請按照以下步驟操作。

  1. 開放XSlidableTabController.m
  2. - (void)viewWillLayoutSubviews方法

添加下面的代碼在最後

// change 20 to any other what ever you want. 
[_tabView setFrame:CGRectMake(0, 20, self.view.frame.size.width, _tabHeight)]; 
[self.view bringSubviewToFront:_tabView]; 

也許這會幫助你。

+0

三江源幫助,這是新的我bringSubviewToFront,我總是看到addsubview,我可以送你到谷歌+ – 2014-11-06 08:53:14

+0

OK請求。你可以發送。 – 2014-11-06 08:54:45

+0

@ user3899589完成了嗎? – 2014-11-06 09:18:20

1

只需更改XSlidableTabController.m中viewWillLayoutSubviews方法中的baseY值。 enter image description here

- (void)viewWillLayoutSubviews 
{ 
[super viewWillLayoutSubviews]; 
CGFloat baseY = 60.0f, width = self.view.frame.size.width; 
CGRect rtTabMenu = CGRectMake(0, baseY, width, _tabHeight); 
[_tabView setFrame:rtTabMenu]; 
baseY += rtTabMenu.size.height; 
CGRect rtContent = CGRectMake(0, baseY, width, self.view.frame.size.height - baseY); 
[_scrollView setFrame:rtContent]; 
CGSize szScrollContent = _scrollView.contentSize; 
szScrollContent.height = rtContent.size.height; 
[_scrollView setContentSize:szScrollContent]; 
} 
+0

它會佔用整個控制器。他只想拿下標籤。 – 2014-11-06 11:56:19