Which is the UIBarButtonItem used in the Recent calls view of the Phone app?
It doesn't look like a public API I know of. How can I create a similar UIBarButtonItem?
Which is the UIBarButtonItem used in the Recent calls view of the Phone app?
It doesn't look like a public API I know of. How can I create a similar UIBarButtonItem?
您可以将Segment控制器添加到UIToolBar中。所以它看起来像你想要的。
欢呼者
它是由类似下面的东西完成的,没有使用公共 api..
UIToolbar *toolbar=[[UIToolbar alloc] init];
[toolbar setItems:[NSArray arrayWithObjects:@"All",@"Missed", nil]];
self.navigationItem.titleView=toolbar;
你可以试试这个
NSArray *segItemsArray = [NSArray arrayWithObjects: @"All", @"Missed", nil];
UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:segItemsArray];
UIBarButtonItem *flexibleSpace= [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
NSArray *barArray = [NSArray arrayWithObjects: flexibleSpace,segmentedControl, nil];
[toolbar setItems:barArray];
选项1:
将UISegmentedControl添加到UIToolBar
选项 2:(如果您使用的是导航控制器)
将UISegementControl添加到UINavigationBar