Twitter Specific Keyboard UIKeyboardTypeTwitter - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Saturday, April 14, 2012

Twitter Specific Keyboard UIKeyboardTypeTwitter

In iOS 5 if you are creating a custom control such as aUITextField or UITextView, there is a keyboard type specifically designed for writing tweets – the keyboard includes the characters @ and # on the primary view (no tapping necessary for a secondary keyboard view).

The following code example shows how to set the twitter keyboard in a UITextView:

UITextView *twitterView;
...
twitterView = [[UITextView alloc] initWithFrame:CGRectMake(10, 40, 300, 100)];
[twitterView setBackgroundColor:[UIColor whiteColor]];
[twitterView setFont:[UIFont fontWithName:@"Arial" size:18]];
[twitterView setKeyboardType:UIKeyboardTypeTwitter];
 
[[self view] addSubview:twitterView];

No comments:

Post a Comment