0
我有一個UICollectionViewController並試圖設置導航標題.. 但這些都沒有工作......它不顯示文本!設置導航標題文本
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
self.titleLabel.backgroundColor = [UIColor clearColor];
self.titleLabel.font = [UIFont fontWithName:@"ArialHebrew-Bold" size:15];
self.titleLabel.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
self.titleLabel.textAlignment = NSTextAlignmentCenter;
self.titleLabel.textColor = [UIColor whiteColor];
self.titleLabel.text = [self.navigationItem title];
self.navigationItem.titleView = self.titleLabel;
[self.titleLabel setText:@"title"];
self.navigationItem.title = @"The title";