Câu hỏi được gắn thẻ «textlabel»

4
Có thể điều chỉnh vị trí x, y cho titleLabel of UIButton không?
Có thể điều chỉnh vị trí x, y cho titleLabelcủa a UIButtonkhông? Đây là mã của tôi: 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 = ???
Khi sử dụng trang web của chúng tôi, bạn xác nhận rằng bạn đã đọc và hiểu Chính sách cookie và Chính sách bảo mật của chúng tôi.
Licensed under cc by-sa 3.0 with attribution required.