I want to draw custom button on Navigat开发者_如何学Pythonion bar.
Can anybody help me.
simple
[[UIBarButtonItem alloc] initWithCustomView: customButton];
will work
so something like that:
UIButton *button = [UIButton buttonWithType: UIButtonTypeCustom];
[button setImage:[UIImage imageNamed:@"animage.png"]];
[button addTarget:self action:@selector(onClick:) forControlEvents: UIControlEventTouchUpInside];
UIBarButtonItem *customItem = [[UIBarButtonItem alloc] initWithCustomView: button];
[self.navigationItem setLeftBarButtonItem:customItem];
Cheers, Krzysztof Zabłocki
UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithTitle:@"DontWorryAboutThis" style:UIBarButtonItemStylePlain target:self action:@selector(method:)];
[barButton setImage:[UIImage imageNamed:@"animage.png"]];
[self.navigationItem setLeftBarButtonItem:barButton];
      UIBarButtonItem *btn=[[UIBarButtonItem alloc] initWithTitle:@"Button" style:UIBarButtonItemStylePlain target:self action:@selector(btnPressed)];
      [self.navigationItem setRightBarButtonItem:btn];
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论