SORU
11 Mayıs 2010, Salı


konumunu ayarlamak için olası x,UİButton bu titleLabel y?

işte benim kod

UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];

[btn setFrame:CGRectMake(0.0f, 0.0f, 100.0f, 100.0f)];
[btn setTitle:[NSString stringWithFormat:@"Button %d", i 1] forState:UIControlStateNormal];     
[btn addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
btn.titleLabel.frame = ???

CEVAP
21 Mayıs 2010, Cuma


//make the buttons content appear in the top-left
[button setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
[button setContentVerticalAlignment:UIControlContentVerticalAlignmentTop];

//move text 10 pixels down and right
[button setTitleEdgeInsets:UIEdgeInsetsMake(10.0f, 10.0f, 0.0f, 0.0f)];

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

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Besnik Ibrahimi

    Besnik Ibrah

    27 Mart 2010
  • kamaniusilelis

    kamaniusilel

    10 HAZİRAN 2011
  • Karan Thakur

    Karan Thakur

    23 HAZİRAN 2010