iPhoneでは、アクションシートが画面の幅全体を占める方法が好きで、高さを選択できます(他のビューを含めることができます)。これがアクションビューを作成する私の全体のメソッドです(おそらく数行必要ですが)...
-(void)createActionView {
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:@"Done",nil];
[actionSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
UIButton *downHoleScore = [UIButton buttonWithType:UIButtonTypeCustom];
downHoleScore.frame = CGRectMake(93, 75, 35, 35);
[downHoleScore setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
downHoleScore.backgroundColor = [UIColor clearColor];
downHoleScore.tag=1;
[downHoleScore addTarget:self action:@selector(HoleScoreButtonTap:) forControlEvents:UIControlEventTouchUpInside];
[downHoleScore setBackgroundImage:[UIImage imageNamed:@"Left-Down-Arrow.png"] forState:UIControlStateNormal];
[actionSheet addSubview:downHoleScore];
UIButton *upHoleScore = [UIButton buttonWithType:UIButtonTypeCustom];
upHoleScore.frame = CGRectMake(193, 76, 35, 35);
[upHoleScore setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
upHoleScore.backgroundColor = [UIColor clearColor];
upHoleScore.tag=2;
[upHoleScore addTarget:self action:@selector(HoleScoreButtonTap:) forControlEvents:UIControlEventTouchUpInside];
[upHoleScore setBackgroundImage:[UIImage imageNamed:@"Right-Up-Arrow.png"] forState:UIControlStateNormal];
[actionSheet addSubview:upHoleScore];
golferScoreLabel = [[UILabel alloc] initWithFrame:CGRectMake(140, 70, 45, 45)];
golferScoreLabel.text = @"0";
golferScoreLabel.backgroundColor = [UIColor clearColor];
golferScoreLabel.font = [UIFont fontWithName:@"ChalkDuster" size: 45.0];
golferScoreLabel.textAlignment = UITextAlignmentCenter;
golferScoreLabel.shadowColor = [UIColor grayColor];
golferScoreLabel.shadowOffset = CGSizeMake(1,1);
golferScoreLabel.textColor = [UIColor whiteColor];
[actionSheet addSubview:golferScoreLabel];
CGRect pickerFrame = CGRectMake(0, 120, 0, 0);
UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:pickerFrame];
pickerView.showsSelectionIndicator = YES;
pickerView.dataSource = self;
pickerView.delegate = self;
[actionSheet addSubview:pickerView];
[actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
[actionSheet showFromRect:CGRectMake(0, 0, 320, 585) inView:self.view animated:YES];
}
これを編集して、iPhoneのアクションビューのように見せることはできますか?
このコードでは...
[actionSheet showFromRect:CGRectMake(0, 0, 320, 585) inView:self.view animated:YES];
上記は私が混乱していると思うところです。iPadの画面の下半分全体をこれでカバーするにはどうすればよいですか?