Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Draw This
($0.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-28-2009, 02:14 AM   #1 (permalink)
svveet
Registered Member
 
Join Date: Jun 2009
Location: Australia
Posts: 180
svveet is on a distinguished road
Default Slide Keyboard From Right

I want to create a view just like iphone's contact edit view.

I have A UITextField inside UITableViewCell.

I want to focus on the UITextField inside the UITableViewCell, and make the keyboard slides with the view from the right.
now its appearing without sliding, but the view is.

Here is the code:

Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
	
    static NSString *TrackEditCellIdentifer = @"TrackEditCellIdentifer";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:TrackEditCellIdentifer];
	
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:TrackEditCellIdentifer] autorelease];
		
		UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(10, 14, 200, 25)];
		textField.clearsOnBeginEditing = NO;
		textField.returnKeyType = UIReturnKeyDone;
		textField.font = [UIFont boldSystemFontOfSize:14];
		textField.enabled = YES;
		textField.tag = kTextFieldTag;
		textField.textColor = [UIColor blackColor];
		[textField becomeFirstResponder];
		[cell.contentView addSubview:textField];
		[textField release];

    }
	
	// Set up the cell...
	//NSUInteger row = [indexPath row];
	
	// determine the textfield
	UITextField *txtfield = (UITextField *)[cell viewWithTag:kTextFieldTag];
	txtfield.text = self.textFieldString;
	
	if ([self textType] == kNameKey)
		[txtfield setPlaceholder:@"Name"];
	if ([self textType] == kTagKey)
		[txtfield setPlaceholder:@"Tags"];
	
	[self setCurrentTextField:txtfield];

    return cell;
}
i have tried calling this in viewdidload and viewdidappear, but the results are the same.

Code:
- (void)viewDidLoad {
	[currentTextField becomeFirstResponder];
    [super viewDidLoad];
}

- (void)viewDidAppear:(BOOL)animated {
	[currentTextField becomeFirstResponder];
    [super viewWillAppear:animated];
}
svveet is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,014
Threads: 93,862
Posts: 401,918
Top Poster: BrianSlick (7,962)
Welcome to our newest member, Shimi574
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:24 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.