用**leftBarButtonItem**,但是我想讓它移動的更往右點,它現在貼在左邊的位置。有什麼解決辦法嗎?
這是Button的按鈕:
[UIButton buttonWithType:UIButtonTypeCustom];
[button setBackgroundImage:[UIImage imageNamed:@"task_status.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(changeStatus:) forControlEvents:UIControlEventTouchUpInside];
[button setFrame:CGRectMake(80, 0,100, 18)];
self.tabBarController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
多謝
UIBarButtonItem *flexBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target: action:]
UIBarButtonItem *flexBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:<#(id)#> action:<#(SEL)#>]
試試看,記得是用 下面類型的 barbuttonItem