autorotation and a alertview
I start my app with a UIalertview which is a password screen.
1.my return key dosen't work on my keyboard
2.when I autorotate to landscape my UIalertview box is covered by the keyboard(the UIalertView is centered in the screen)...anyway to shift the UIalertview up?
3.if I return it back to portrait the UIalertview is moved(centered) where is is also covered by the keyboard.
4.I am also trying to find some way to search my uiwebview/pdf so any help with this would be appreciated
here is my code..please help lol..i've been losing my mind with this...Thanks......
#import "YearbookViewController.h"
@implementation YearbookViewController
@synthesize webView, pdfUrl;
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIIn terfaceOrientation)interfaceOrientation {
return YES;
}
- (void)viewDidLoad{
UIAlertView *prompt = [[UIAlertView alloc] initWithTitle:@"Password"
message:@"n/n/n/" // IMPORTANT
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"Enter", nil];
textField2 = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)];
[textField2 setBackgroundColor:[UIColor whiteColor]];
[textField2 setPlaceholder:@"password"];
[textField2 setSecureTextEntry:YES];
[prompt addSubview:textField2];
// set place
[prompt setTransform:CGAffineTransformMakeTranslation(0.0, 115.0)];
[prompt show];
[prompt release];
// set cursor and show keyboard
[super viewDidLoad];
webView.scalesPageToFit=YES;
webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
NSString *pdfPath = [[NSBundle mainBundle] pathForResource:@"2009EVFalcon" ofType:@"pdf"];
/*
If we have to take from its operational directory, then the next 4 lines will be used...
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDire ctory, NSUserDomainMask, YES);
NSString *saveDirectory = [paths objectAtIndex:0];
NSString *saveFileName = @"myPDF.pdf";
NSString *pdfPath = [saveDirectory stringByAppendingPathComponent:saveFileName];
*/
self.pdfUrl = [NSURL fileURLWithPath:pdfPath];
[webView loadRequest:[NSURLRequest requestWithURL:pdfUrl]];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if ([textField2.text isEqualToString: @"MyPassword"]) {
}
else{
UIAlertView *prompt = [[UIAlertView alloc] initWithTitle:@"Password"
message:@"n/n/n/" // IMPORTANT
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"Enter", nil];
textField2 = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)];
[textField2 setBackgroundColor:[UIColor whiteColor]];
[textField2 setPlaceholder:@"password"];
[textField2 setSecureTextEntry:YES];
[prompt addSubview:textField2];
// set place
[prompt setTransform:CGAffineTransformMakeTranslation(0.0, 115.0)];
[prompt show];
[prompt release];
// set cursor and show keyboard
[textField2 becomeFirstResponder];
}
}
- (void)dealloc
{
[webView release];
[pdfUrl release];
[super dealloc];
}
@end
anyone have any ideas? anything??????
Last edited by evfalcon; 02-18-2010 at 10:26 AM.
|