Tag: 文本标签

是否可以调整UIButton的位置x,y titleLabel?

这是我的代码 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 = ???