Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)viewDidLoad {
  2.     [super viewDidLoad];
  3.    
  4.     self.itemSortPicker.hidden = false;
  5.    
  6.     pickerData = @[@"Name",@"Item Level",@"Crafting Level",@"Profit",@"Profit Percentage",@"Sell Price",@"Buy Price",@"Supply",@"Demand",@"Rarity"];
  7.    
  8.     self.itemSortPicker.dataSource = self;
  9.     self.itemSortPicker.delegate = self;
  10.    
  11.    
  12.     UIToolbar *pickerToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
  13.    
  14.     pickerToolbar.barStyle = UIBarStyleDefault;
  15.     [pickerToolbar sizeToFit];
  16.    
  17.     [pickerToolbar setFrame:CGRectMake(0, -pickerToolbar.bounds.size.height, 320, 44)];
  18.    
  19.     NSMutableArray *barItems = [[NSMutableArray alloc] init];
  20.    
  21.    
  22.     UIBarButtonItem *cancelBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(pickerCancel)];
  23.     [barItems addObject:cancelBtn];
  24.    
  25.     UIBarButtonItem *flexSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
  26.     [barItems addObject:flexSpace];
  27.    
  28.     UIBarButtonItem *doneBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(pickerDone)];
  29.     [barItems addObject:doneBtn];
  30.    
  31.     [pickerToolbar setItems:barItems animated:YES];
  32.    
  33.     CGRect pickerRect = self.itemSortPicker.bounds;
  34.     self.itemSortPicker.bounds = pickerRect;
  35.     self.itemSortPicker.frame = CGRectMake(0, 44, 320, 216);
  36.    
  37.     [self.itemSortPicker addSubview:pickerToolbar];
  38.    
  39.     //UIView* popoverView = [[UIView alloc] initWithFrame:CGRectMake(0, 44, 320, 300)];
  40.     //popoverView.backgroundColor = [UIColor whiteColor];
  41.     //[popoverView addSubview:self.itemSortPicker];
  42.    
  43.     //[popoverView addSubview:pickerToolbar];
  44.     //[self.view addSubview:popoverView];
  45.    
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement