如何在UIButton的文本右侧添加详细信息公开按钮,也许使用边缘插入?
答案 0 :(得分: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];