UINavigationBar BarButtonItem with Plain Style

前端 未结 8 2191
不思量自难忘°
不思量自难忘° 2020-12-14 09:19

i got the following code:

- (id)init {
  if (self = [super init]) {
      self.title = @\"please wait\";
      UIBarButtonItem *favorite = [[UIBarButtonItem          


        
相关标签:
8条回答
  • 2020-12-14 09:40

    Why not try UI7Kit? Works well for me, easy to use.

    0 讨论(0)
  • 2020-12-14 09:46
        UIImage *img = [UIImage imageNamed:@"white_star.png"];
    
          CGSize itemSize = CGSizeMake(20, 20);
          UIGraphicsBeginImageContext(itemSize);
          CGRect imageRect = CGRectMake(0.0, 0.0, itemSize.width, itemSize.height);
          [img drawInRect:imageRect];
          img = UIGraphicsGetImageFromCurrentImageContext();
          UIGraphicsEndImageContext();
    
    
      UIBarButtonItem *barButton = [[UIBarButtonItem alloc ] initWithImage:img style:UIBarButtonSystemItemAdd target:self action:@selector(favoriteButtonClicked)];
      barButton.style = UIBarButtonItemStyleBordered;
    
    0 讨论(0)
提交回复
热议问题