我必须制作 iPad 应用程序。
有三个问题textfields
。我必须UITextField
动态设置宽度,text
来自webservice。我必须设置UITextField
与问题文本相同的宽度..
当文本问题大小较小UITextField
时,大小较小,当文本问题大小较大时UITextField
,大小较大,
我有以下代码.....
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;
}
请帮助我,我不知道我该怎么办?