07-01-2010, 12:20 PM
#26 (permalink )
Registered Member
Join Date: Jan 2010
Location: NYC
Posts: 37
Quote:
Originally Posted by
jonahgabriel
Apple changed the class name of the keyboard subview, so this will never be true:
if([[keyboard description] hasPrefix:@"<UIKeyboard"] == YES)
Ahh that would do it. Happen to know the new name?
07-01-2010, 12:35 PM
#27 (permalink )
Registered Member
Join Date: Feb 2009
Posts: 165
Quote:
Originally Posted by
beleg_1998
Ahh that would do it. Happen to know the new name?
I don't offhand.
Just loop though the views and log the description to the console.
07-02-2010, 11:50 AM
#28 (permalink )
Registered Member
Join Date: Jan 2010
Location: NYC
Posts: 37
Quote:
Originally Posted by
jonahgabriel
I don't offhand.
Just loop though the views and log the description to the console.
hmmmm. I tried that. Looks like the only description is UIlayoutContainerView, but since this is a undocumented part of the SDK my fear is if I use it then I will rejected by the itunes store.
anyone have any suggestions?
07-02-2010, 04:00 PM
#29 (permalink )
Registered Member
Join Date: Feb 2009
Posts: 165
Quote:
Originally Posted by
beleg_1998
hmmmm. I tried that. Looks like the only description is UIlayoutContainerView, but since this is a undocumented part of the SDK my fear is if I use it then I will rejected by the itunes store.
anyone have any suggestions?
You need to do it recursively.
07-08-2010, 12:54 PM
#30 (permalink )
Registered Member
Join Date: Jan 2010
Location: NYC
Posts: 37
Quote:
Originally Posted by
jonahgabriel
You need to do it recursively.
I am not sure I follow you. I know what recursion is, but I am not sure how I would apply it to this situation.
07-08-2010, 01:12 PM
#31 (permalink )
Registered Member
Join Date: Feb 2009
Posts: 165
You said:
Quote:
Originally Posted by
beleg_1998
hmmmm. I tried that. Looks like the only description is UIlayoutContainerView, but since this is a undocumented part of the SDK my fear is if I use it then I will rejected by the itunes store.
anyone have any suggestions?
You only looped though the the first view. You need to also loop though all subviews of any views you find and any subviews of those views and so on, until you find the keyboard view.
Code:
-(void)keyboardWasShown
{
for(UIView *subView in self.view.subviews)
{
[self checkViews:subView];
}
}
-(void)checkViews:(UIView *)inView
{
for(UIView *subView in inView.subviews)
{
NSLog( "ViewName: %@", [view desc] );
//Look for keyboard name here, if name found, break
[self checkViews:subView];
}
}
Something like this should work.
09-13-2010, 12:54 PM
#32 (permalink )
Registered Member
Join Date: Sep 2010
Posts: 1
Help
[quote=Praveen]
Can you tell me where to add the below code?
Where ever I add it shows me a error message......
Code:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];
09-13-2010, 01:06 PM
#33 (permalink )
Registered Member
Join Date: Feb 2009
Posts: 165
[quote=rhpraveen;244990]
Quote:
Originally Posted by Praveen
Can you tell me where to add the below code?
Where ever I add it shows me a error message......
Code:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];
Depending on your app, either viewDidLoad or viewWillAppear.
09-24-2010, 06:23 AM
#34 (permalink )
Registered Member
Join Date: Oct 2008
Posts: 370
We can use this property inputAccessoryView - OS 3.2 and later.
Code:
UIToolbar *boolbar = [UIToolbar new];
boolbar.barStyle = UIBarStyleDefault;
[boolbar sizeToFit];
UIBarButtonItem *cancelleftBarButton =[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(buttonClicked:)];
NSArray *array = [NSArray arrayWithObjects:cancelleftBarButton, nil];
[cancelleftBarButton release];
[boolbar setItems:array];
myTextField.inputAccessoryView = boolbar;
__________________
lazy blogs
The Lord's holy name be praised.
Thread Tools
Display Modes
Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
» Advertisements
» Online Users: 263
14 members and 249 guests
2WeeksToGo , AdamL , ADY , BrianSlick , Dani77 , Dattee , headkaze , mer10 , prchn4christ , smithdale87 , timle8n1 , Touchmint , vigu360
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,879
Threads: 89,228
Posts: 380,747
Top Poster: BrianSlick (7,129)
Welcome to our newest member, mgon987