在 navigation bar 設定了背景顏色,並且右邊的 navigation item 使用 toolbar 來包2個 button 。
UIToolbar *toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 90, 44)];
toolBar.barStyle = -1; //透明背景
toolBar.clipsToBounds = YES; //修正上方的線
[toolBar setItems:@[shareBarButton, favoriteBarButton] animated:NO];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:toolBar];