Note that there are some explanatory texts on larger screens.

plurals
  1. POios : create NavigationBar programmatically, but cannot set the title
    primarykey
    data
    text
    <p>I create an NavigationBar programmaticlly without using xib file. And create one left button with text "left", added to the navigationBar, and set the title to "Demo".</p> <p>code :</p> <pre><code>-(void) createNavBar:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options { self.navBarController = [[[UINavigationController alloc] init] autorelease]; navBar = [navBarController navigationBar]; navBarController.navigationBar.bounds = CGRectMake(0, 0, 320, navBarHeight); [navBarController.navigationBar setBackgroundImage:[[UIImage imageNamed:@"www/images/ios_hd_bg.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 0, 2, 0)] forBarMetrics:UIBarMetricsDefault]; [navBarController view]; navBarController.navigationItem.title = @"title"; [navBarController.view setFrame:navBarController.navigationBar.bounds]; UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom]; button = [self renderNavBarTextBtn:@"left" withButton:button direction:@"left"]; [navBar addSubview:button]; [[[self webView] superview] addSubview: navBarController.view]; } </code></pre> <p>however, the program can successfully set the navigationbar background image, show the left button, but cannot set the title. so strange?</p> <p>complements: I use cordova framework to invoke . and The inteface just be provided to cordova invoke. Thanks for answers below, but I still can't solve my problem.</p> <p>ScreenShot: (Note: showing the left button but not showing the title)</p> <p><img src="https://i.stack.imgur.com/yo2E4.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload