對不起,簡單的問題,但下面的代碼:獲取導航欄的框架與UINavigationBar的外觀
[[UINavigationBar appearance] setBackgroundImage:[UIImage
imageNamed:@"backgroundNavigationBar.png"] forBarMetrics:UIBarMetricsDefault];
CGRect frame = [[UINavigationBar appearance] frame];
NSLog(@"%@", NSStringFromCGRect(frame));
UIView *view = [[UIView alloc] initWithFrame:frame];
[[UINavigationBar appearance] addSubview: view];
給我
{{0, 0}, {0, 0}}
如何正確獲取當前導航欄的框架與實際尺寸,即320x64?