SORU
20 Mart 2009, Cuma


Renk ile UİBarButtonİtem?

Kırmızı bir UİBarButtonİtem olması mümkün mü?

CEVAP
13 Mayıs 2011, Cuma


Eğer kodu tam olarak basit bir UİBarButtonİtem çoğaltmak için arıyor:

UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setBackgroundImage:[UIImage imageNamed:@"delete.png"] forState:UIControlStateNormal];
[button setTitle:@"Delete" forState:UIControlStateNormal];
button.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:12.0f];
[button.layer setCornerRadius:4.0f];
[button.layer setMasksToBounds:YES];
[button.layer setBorderWidth:1.0f];
[button.layer setBorderColor: [[UIColor grayColor] CGColor]];
button.frame=CGRectMake(0.0, 100.0, 60.0, 30.0);
[button addTarget:self action:@selector(batchDelete) forControlEvents:UIControlEventTouchUpInside];

UIBarButtonItem* deleteItem = [[UIBarButtonItem alloc] initWithCustomView:button];

Ve silin.png:

delete.png

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Bigapplemagic

    Bigapplemagi

    22 EYLÜL 2011
  • Chuck Testa

    Chuck Testa

    14 AĞUSTOS 2011
  • Strata1000

    Strata1000

    28 EYLÜL 2009