0

如何在 UIButton 中的文本右侧添加详细信息披露按钮,可能使用边缘插图?

4

1 回答 1

1

您可以创建一个UIButton类型UIButtonTypeDetailDisclosure并将其添加为按钮的子视图。

喜欢:

UIButton *mainButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[mainButton setTitle:@"Click" forState:UIControlStateNormal];
[mainButton setFrame:CGRectMake(10, 10, 100, 50)];
[self.view addSubview:mainButton];

//Detail Disclosure button
UIButton *detailButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[detailButton setFrame:CGRectMake(70, 10, 30, 30)];
[mainButton addSubview:detailButton];
于 2013-09-10T09:19:52.533 回答