我是Xcode编程的新手,我没有在另一个Tread中找到正确的答案。 我的问题:我有一个带有CardQuestion(TextView)和CardAnser(TextView)的Detailview。 如何将不可见的答案更改为可见。 在操作按钮“显示答案”。
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = self.chosenCard.name;
self.cardName.text = self.chosenCard.name;
self.cardQuestion.text = self.chosenCard.question;
self.cardAnswer.text = self.chosenCard.answer;
}
- (void)viewDidUnload
{
[self setCardName:nil];
[self setCardQuestion:nil];
[self setCardAnswer:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (IBAction)toAnswerButton:(id)sender{
}
@end
我希望你能理解我的问题。
答案 0 :(得分:0)
UIView
子视图(包括UILabel
,UITextField
和UITextView
)具有隐藏属性。将其设置为YES
以隐藏视图,并设置为NO
以取消隐藏。您也可以在Interface Builder中设置此属性。