I have to make iPad application.
There are three questions textfields
. I have to set width UITextField
dynamically, text
is coming from webservice. and I have to set UITextField
width same as questions text..
when texts question size is small then UITextField
size is small,
when texts question size is large then UITextField
size is large,
I have following code.....
txtQuestionOne.hidden=NO;
txtQuestionTwo.hidden=NO;
txtQuestionThree.hidden=NO;
imgQueone.hidden=NO;
imgQueTwo.hidden=NO;
imgQueThree.hidden=NO;
[txtQuestionOne setPlaceholder:[[appDelegate.questions objectAtIndex:0] objectForKey:@"question"]];
appDelegate.FirstQues =[[appDelegate.questions objectAtIndex:0] objectForKey:@"question"];
NSLog(@"current q1 %@", [[appDelegate.questions objectAtIndex:0] objectForKey:@"question"]);
if ([[[appDelegate.questions objectAtIndex:0] objectForKey:@"permission"] isEqualToString:@"1"]) {
ratingButton1.hidden=NO;
ratingLabel1.hidden=NO;
}
[txtQuestionTwo setPlaceholder:[[appDelegate.questions objectAtIndex:1] objectForKey:@"question"]];
appDelegate.SecondQues =[[appDelegate.questions objectAtIndex:1] objectForKey:@"question"];
NSLog(@"current q2 %@", [[appDelegate.questions objectAtIndex:1] objectForKey:@"question"]);
if ([[[appDelegate.questions objectAtIndex:1] objectForKey:@"permission"] isEqualToString:@"1"]) {
ratingButton2.hidden=NO;
ratingLabel2.hidden=NO;
}
[txtQuestionThree setPlaceholder:[[appDelegate.questions objectAtIndex:2] objectForKey:@"question"]];
appDelegate.ThridQues =[[appDelegate.questions objectAtIndex:2] objectForKey:@"question"];
NSLog(@"current q3 %@", [[appDelegate.questions objectAtIndex:2] objectForKey:@"question"]);
if ([[[appDelegate.questions objectAtIndex:2] objectForKey:@"permission"] isEqualToString:@"1"]) {
ratingButton3.hidden=NO;
ratingLabel3.hidden=NO;
}
Please help me i dont know what can i do?