2012-05-07 223 views

回答

1

設置您的導航欄框架,並使其在框架中減少y方向。嘗試此操作。

self.navigationController.navigationBar.frame=CGRectMake(<#CGFloat x#>, <#CGFloat y#>, <#CGFloat width#>, <#CGFloat height#>); 

使它y = -10和高度= 30;並根據您的要求進行檢查和調整。

UIView *BtnView = [[UIView alloc] initWithFrame:CGRectMake(0,0,300,30)]; 
UILabel *compete_Label=[[UILabel alloc]initWithFrame:CGRectMake(100, 5, 60, 20)]; 
[compete_Label setText:@"Your Title name"]; 

compete_Label.backgroundColor=[UIColor clearColor]; 
[compete_Label setFont:[UIFont fontWithName:@"Helvetica-Bold" size:12]]; 
compete_Label.textColor=[UIColor whiteColor]; 
[BtnView addSubview:compete_Label]; 
[self.View addSubView:BtnView]; 

試試這個代碼我認爲這將是爲你工作。

+0

感謝您的答覆vishiphone。 我試過你建議的解決方案,黑色空間還在那裏。 –

+0

檢查您的視圖背景顏色是否是黑色? – vishiphone

+0

我希望它是純白色的!這是我檢查的第一件事情之一。 –

0

如果使導航欄較小,則應該使的tableview幀位置相應地,使得它的起源-Y被設置爲導航欄的底部。

設置的tableview起源-Y和調整的tableview的高度。

+0

嘿Aadhira,謝謝你的迴應。我試過使用這樣的東西:[self.tableView setFrame:CGRectMake(0,-10,320,480)]; 然而,實現代碼如下不動.... –