我有一个UITableView
以上的UITextField
。当我反复选择拉伸UITextField
时。UITableView
这是我的 onViewLoad 代码:
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = @"Clock In Time";
CALayer *layer= pickUpWeighCapacityList.layer;
UIColor* uic = UIColorFromRGB(0x336600);
CGColorRef* cgf = uic.CGColor;
layer.borderWidth = 2;
layer.borderColor = cgf;
layer.cornerRadius = 10;
layer.frame = CGRectMake(20.0f, 33.0f, 280.0f, 178.0f);
pickUpWeighCapacityList.dataSource = self;
pickUpWeighCapacityList.delegate = self;
pickUpWeighCapacityList.tableHeaderView = nil;
pickUpWeighCapacityList.tableFooterView = nil;
pickUpWeighCapacityList.frame = CGRectMake(20.0f, 33.0f, 280.0f, 178.0f);
i = 0;
signOutTimeField.placeholder = @"Time to Clock Out of Work";
picker = [[UIDatePicker alloc] init];
signOutTimeField.inputView = picker;
UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"Done"
style:UIBarButtonSystemItemDone target:self action:@selector(doneEditing)];
self.navigationItem.rightBarButtonItem = rightButton;
[rightButton release];
[picker release];
}
这是我对视图功能的代码:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return 3;
}
我怎样才能得到UITableView
不伸展?(iOS 4.3。XCode 3.2.6——不要评判我)。