0
我想把這個在導航欄中,但沒有顯示出來,你可以在 看看嗎?分段控制導航欄
UISegmentedControl *seg1 = [[UISegmentedControl alloc]
initWithItems:[NSArray arrayWithObjects:@"von mir", @"alle", nil]];
[seg1 setSegmentedControlStyle:UISegmentedControlStyleBar];
UIBarButtonItem *barItem = [[UIBarButtonItem alloc] initWithCustomView:seg1];
UIBarButtonItem *flexItem = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:self action:nil];
[self.navigationController.navigationBar setItems:[NSArray
arrayWithObjects:flexItem, barItem, flexItem, nil]];
[flexItem release];
[barItem release];
[seg1 release];
只是一個想法,不能使用IB來做到這一點。 – Robin 2011-02-19 04:46:47
是的,但我因爲某種原因與代碼接口 – Maysam 2011-02-19 05:30:58