Вы создаете UIView в любом случае вы хотите, и селекторы инициировать это походить на то же чувство:
Возьмите эту картину, например:
Представление может быть сделано, как это уведомление filterView добавляется к супер-представлению, потому что я установил userInteractionEnabled для NO для представления, поэтому пользователям предлагается выбрать опцию, прежде чем продолжить использовать представление, однако это необязательно. Я просто указывал:
self.view.userInteractionEnabled = NO;
[self.navigationItem.rightBarButtonItem setEnabled:NO];
self.filterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 150, 150)];
float X_CO = (self.view.superview.bounds.size.width - self.filterView.frame.size.width)/2;
float Y_CO = (self.view.superview.bounds.size.width - self.filterView.frame.size.height)/2;
[self.filterView setFrame:CGRectMake(X_CO, Y_CO + 75, 150, 150)];
self.filterView.backgroundColor = [UIColor whiteColor];
self.filterView.layer.borderColor = [UIColor lightGrayColor].CGColor;
self.filterView.layer.borderWidth = 1.0f;
self.filterView.layer.cornerRadius = 8.0f;
self.filterView.layer.shadowColor = [UIColor blackColor].CGColor;
self.filterView.layer.shadowOpacity = 0.5f;
self.filterView.layer.shadowOffset = CGSizeMake(0, 1);
self.filterView.layer.masksToBounds = NO;
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 150, 50)];
titleLabel.textAlignment = NSTextAlignmentCenter;
titleLabel.text = @"Select Filter Option:";
titleLabel.font = [UIFont fontWithName:@"Eurostile" size:13];
titleLabel.textColor = [UIColor colorWithRed:48/255 green:131/255 blue:251/255 alpha:1];
[self.filterView addSubview:titleLabel];
self.azButton = [[UIButton alloc] initWithFrame:CGRectMake(10,self.filterView.frame.origin.y/3.5,30, 30)];
[self.azButton setBackgroundColor:[UIColor whiteColor]];
[self.azButton addTarget:self action:@selector(filterButton:) forControlEvents:UIControlEventTouchUpInside];
self.azButton.layer.borderColor = [UIColor lightGrayColor].CGColor;
self.azButton.layer.cornerRadius = 15.0f;
self.azButton.layer.borderWidth = 1.0f;
[self.filterView addSubview:self.azButton];
UILabel *azLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.azButton.frame.origin.x + 40, self.azButton.frame.origin.y, 95, 30)];
azLabel.textAlignment = NSTextAlignmentLeft;
azLabel.text = @"A-Z Sort";
azLabel.textColor = [UIColor blackColor];
azLabel.font = [UIFont fontWithName:@"Eurostile" size:20];
[self.filterView addSubview:azLabel];
self.zaButton = [[UIButton alloc] initWithFrame:CGRectMake(10, self.azButton.frame.origin.y + 40,30, 30)];
[self.zaButton setBackgroundColor:[UIColor whiteColor]];
[self.zaButton addTarget:self action:@selector(filterButton:) forControlEvents:UIControlEventTouchUpInside];
self.zaButton.layer.borderColor = [UIColor lightGrayColor].CGColor;
self.zaButton.layer.cornerRadius = 15.0f;
self.zaButton.layer.borderWidth = 1.0f;
[self.filterView addSubview:self.zaButton];
UILabel *zaLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.azButton.frame.origin.x + 40, self.zaButton.frame.origin.y, 95, 30)];
zaLabel.textAlignment = NSTextAlignmentLeft;
zaLabel.text = @"Z-A Sort";
zaLabel.textColor = [UIColor blackColor];
zaLabel.font = [UIFont fontWithName:@"Eurostile" size:20];
[self.filterView addSubview:zaLabel ];
[self.view.superview addSubview:self.filterView];
Вы можете добавить фоновое изображение, чтобы иметь эффект popover.
Затем назовите его в точке касания пользователя.
Просто пример:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[super touchesBegan:touches withEvent:event];
UITouch *touch = [touches anyObject];
if ([touch.view isKindOfClass: UITableView.class]) {
//your touch was in a UITableView ... do whatever you have to do
}
}
, а затем сделать то же самое с touchesEnded: Есть много других способов, чтобы идти об этом, однако. (т. е. найти точную точку контакта и т. д., но это зависит от вас.
Как отметил Дункан С, есть и другие свободно доступные каркасы, доступные для использования.
Конечно, хотя, вы всегда можете создать его в раскадровке или XIb, так много вариантов
Я думаю, что вы должны изменить имитированные показатели на iPad. – MendyK
Что значит? Я разрабатываю для iPhone. –