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

  • Excel Video Tutorials

    Excel Video

    6 Aralık 2012
  • Grace Su

    Grace Su

    6 Ocak 2006
  • The Dubstep FX

    The Dubstep

    5 Mart 2011