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

  • Amir Parmar

    Amir Parmar

    25 Kasım 2010
  • failblog

    failblog

    17 HAZİRAN 2008
  • TheDroidDemos

    TheDroidDemo

    15 ŞUBAT 2011