-(void)textFieldDidEndEditing:(UITextField *)textField{
[textInfo resignFirstResponder];
[self.navigationController setNavigationBarHidden:NO animated:YES];
informationTableView *informationtableView = [[informationTableView alloc] initWithNibName:@"informationTableView"bundle:nil];
UIView* MyView = informationtableView.view;
MyView.frame = CGRectMake(12.0f, 35.0f, 260.0f, 56.0f);
[self.view addSubview:MyView];
UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Choisir" message:@"this gets coveredthis gets coveredthis gets coveredthis gets coveredthis gets coveredthis gets coveredthis gets coveredthis gets coveredthis gets coveredthis gets coveredthis gets coveredthis gets covered" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
[myAlertView addSubview:MyView];
[myAlertView show];
[myAlertView release];
}
问题是TableView不受帧控制。我想在Alert中获取tableView。我怎样才能做到这一点?
答案 0 :(得分:1)
A)我不认为UIAlert在其中有一个tablView会表现得很好。你在找麻烦。 B)我认为您想要使用UIActionSheet,它旨在向用户显示一系列选择。
答案 1 :(得分:1)
你应该这样做:
UIView* MyView = [[UIView alloc] initWithFrame: CGRectMake(12.0f, 35.0f, 260.0f, 56.0f)];
MyView.clipToBound = YES; //this ensures that the subviews are clipped by the view's frame
[MyView addSubview:informationtableView.view];
[self.view addSubview:MyView];