0
我想知道是否可以將我的navigationController標題更靠近欄的頂部?現在看起來像這樣。 移動導航欄標題
我想這將是
self.navigationItem.titleView = [[titleView alloc] initWithFrame:CGRectMake(100,2, 2,100)]];
但我猜titleview的必須是另一種看法?
感謝您的幫助!
我想知道是否可以將我的navigationController標題更靠近欄的頂部?現在看起來像這樣。 移動導航欄標題
我想這將是
self.navigationItem.titleView = [[titleView alloc] initWithFrame:CGRectMake(100,2, 2,100)]];
但我猜titleview的必須是另一種看法?
感謝您的幫助!
在初始化時給框架!
UIView *iv = [[UIView alloc] initWithFrame:CGRectMake(0,0,32,32)];
[iv setBackgroundColor:[UIColor whiteColor]];
self.navigationItem.titleView = iv;
幀越來越小,但它並沒有向上移動。我改變了:UIView * iv = [[UIView alloc] initWithFrame:CGRectMake(0,0,32,32)]; [iv setBackgroundColor:[UIColor whiteColor]]; self.navigationItem.titleView = iv; self.title = NSLocalizedString(@「test title」,@「test title」); –
是的32,32很小,您可能需要根據需要進行調整。 – ApolloSoftware