我不得不調整UINavigationBar的高度爲這個iPhone應用程序後刪除導航欄下方的黑色空間。 現在,當我在tableview中使用較小的navBar時,它下面有一個黑色空間。iPhone - 如何降低高度
我想看到它消失了......
誰能幫助我?非常感激!
視覺:http://tinypic.com/r/2gwchg2/6
我不得不調整UINavigationBar的高度爲這個iPhone應用程序後刪除導航欄下方的黑色空間。 現在,當我在tableview中使用較小的navBar時,它下面有一個黑色空間。iPhone - 如何降低高度
我想看到它消失了......
誰能幫助我?非常感激!
視覺:http://tinypic.com/r/2gwchg2/6
設置您的導航欄框架,並使其在框架中減少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];
試試這個代碼我認爲這將是爲你工作。
如果使導航欄較小,則應該使的tableview幀位置相應地,使得它的起源-Y被設置爲導航欄的底部。
設置的tableview起源-Y和調整的tableview的高度。
嘿Aadhira,謝謝你的迴應。我試過使用這樣的東西:[self.tableView setFrame:CGRectMake(0,-10,320,480)]; 然而,實現代碼如下不動.... –
感謝您的答覆vishiphone。 我試過你建議的解決方案,黑色空間還在那裏。 –
檢查您的視圖背景顏色是否是黑色? – vishiphone
我希望它是純白色的!這是我檢查的第一件事情之一。 –