SPTextField with Input

type:
mod
author:
Brian Ensor
description:
Lets you type into an SPTextField
lastupdate:
2011-03-13
compatible:
v1.1
tag:
text, input, field, keyboard
homepage:
https://gist.github.com/868480
download:
https://gist.github.com/gists/868480/download


My Wiki Page

Usage

You will need to add the files to your Sparrow source.

SPTextField *inputField = [[SPTextField alloc] initWithWidth:300 height:220 text:@"This text is editable.\ninputField.inputEnabled = YES;\ninputField.returnKeyType = UIReturnKeyDone;" fontName:@"Helvetica" fontSize:12 color:0x000000];
inputField.inputEnabled = YES;
inputField.returnKeyType = UIReturnKeyDone;
[self addChild:inputField];
[inputField release];
[inputField addEventListener:@selector(inputBegan:) atObject:self forType:SP_EVENT_TYPE_INPUT_BEGAN];
[inputField addEventListener:@selector(inputEnded:) atObject:self forType:SP_EVENT_TYPE_INPUT_ENDED];
[inputField addEventListener:@selector(inputCancelled:) atObject:self forType:SP_EVENT_TYPE_INPUT_CANCELLED];

Changelog

  • 2011/03/13: First public version

Source Code

Embr

Just tried adding this, I replaced the textfield files in the Sparrow framework and added both lines to my textfield:

inputField.inputEnabled = YES; inputField.returnKeyType = UIReturnKeyDone;

Gave the following errors:

error: request for member 'inputEnabled' in something not a structure or union error: request for member 'returnKeyType' in something not a structure or union

Do I have to add something to the implementation to make it work?

Thanks

  extensions/sp_text_field_input.txt · Last modified: 2015/09/14 11:15 by 127.0.0.1
 
Powered by DokuWiki