- (void)viewDidLoad {
UIButton * testButton = [UIButton buttonWithType:UIButtonTypeCustom];
[testButton setFrame:CGRectMake(0, 0, 60, 30)];
[testButton setTitle:@"测试按钮" forState:UIControlStateNormal];
[self.view addSubview:testButton];
}
var body: some View {
Button(){
Text("测试按钮")
.frame(width: 60, height: 30, alignment: .left)
}
}
网友评论