Advertisement
Guest User

Untitled

a guest
Jul 31st, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. [viewController.navigationItem.rightBarButtonItem setBackgroundVerticalPositionAdjustment:50 forBarMetrics:UIBarMetricsDefault];
  2.  
  3. UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
  4. [btn setBackgroundImage:[UIImage imageNamed:@"chk_back.png"] forState:UIControlStateNormal];
  5. [btn addTarget:self action:@selector(BackBtn) forControlEvents:UIControlEventTouchUpInside];
  6. UIView *customView = [[[UIView alloc] initWithFrame:CGRectMake(0,0, 50, 38)] autorelease];
  7. btn.frame = CGRectMake(10, 3, 30, 32); // where you can set your insets
  8. [customView addSubview:btn];
  9. UIBarButtonItem *barBtn = [[UIBarButtonItem alloc] initWithCustomView:customView];
  10.  
  11. UIBarButtonItem *fixedSpace = [[UIBarButtonItem alloc]
  12. initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
  13. target:nil
  14. action:nil];
  15. [fixedSpace setWidth:20];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement