0

iam a newbie in Xcode programming and i didnt find the right answer in another Tread. My Question: I have a Detailview with a CardQuestion(TextView) and a CardAnser(TextView). How is the method to change the invisible Answer to visible. On Action the Button "Show Answer".

- (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

I hope you can understand my question.

4

1 回答 1

0

UIView子视图(包括UILabel,UITextFieldUITextView)具有隐藏属性。将其设置YES为隐藏视图并NO取消隐藏它。您也可以在 Interface Builder 中设置此属性。

于 2012-06-26T17:03:34.337 回答