,當我按下它,我可以改變自由地查看如何使一個文本框移動
位置 - (IBAction爲)地址:(ID)發送{
CGRect frame = CGRectMake(kLeftMargin, 8.0, kTextFieldWidth, kTextFieldHeight);
UITextField * textfieldToAdd = [[[UITextField alloc] initWithFrame:frame] autorelease];
textfieldToAdd.borderStyle = UITextBorderStyleRoundedRect;
textfieldToAdd.textColor = [UIColor blackColor];
textfieldToAdd.font = [UIFont systemFontOfSize:17.0];
textfieldToAdd.placeholder = @"";
textfieldToAdd.backgroundColor = [UIColor whiteColor];
textfieldToAdd.autocorrectionType = UITextAutocorrectionTypeNo ; // no auto correction support
textfieldToAdd.keyboardType = UIKeyboardTypeDefault; // use the default type input method (entire keyboard)
textfieldToAdd.returnKeyType = UIReturnKeyDone;
textfieldToAdd.clearButtonMode = UITextFieldViewModeWhileEditing; // has a clear 'x' button to the right
textfieldToAdd.tag = kViewTag; // tag this control so we can remove it later for recycled cells
textfieldToAdd.delegate = self; // let us be the delegate so we know when the keyboard's "Done" button is pressed
// Add an accessibility label that describes what the text field is for.
[textfieldToAdd setAccessibilityLabel:NSLocalizedString(@"textfieldToAdd", @"")];
[self.view addSubview:textfieldToAdd];
}
你能對您的問題展開,並用一個例子詳細介紹一下。同時顯示你到目前爲止所嘗試過的。 – gideon 2011-03-24 14:11:20
http://www.flickr.com/photos/[email protected]/5556005854/ – YasBES 2011-03-24 14:19:47
你想拖動文本框? – malinois 2011-03-24 14:24:52