Reputation: 21
Okay - So I've read the "Removing and Re-Adding a subview with autolayout" but I still can't seem to figure out whats going on. I have a UIWebview within my application that prompts upon clicking on a date within a calendar UI. When I click on the first field of the subview "Enter Name", It automatically moves the entire screen and focus to the "Notes" field and the user cannot see any other field. (Id post a picture but I don't have reputation enough yet) There are a few other fields after this in which respond the same way. Check boxes are fine and do not cause an issue. I know that I haven't added any constraints to this subview so I am figuring I need to . I just don't know where to start.
I recently migrated the app to autolayout and everything works great, with the exception of this subview.
The WebUI is responsive in that it adjusts according to the screen/window size so that is not the issue.
Below is my UIWebView subview that loads the URL
- (void)viewDidLoad
{
[super viewDidLoad];
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
NSString *gymString =[prefs stringForKey:@"name_preference"];
[prefs synchronize];
[logView addSubview: activityIndicator];
[logView setBackgroundColor:[UIColor clearColor]];
[logView setOpaque:NO];
[logView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.MYWEBSITE.com/mobiletracking?gym=%@", gymString]]]];
timer = [NSTimer scheduledTimerWithTimeInterval:(1.0/2.0) target:self selector:@selector(loading) userInfo:nil repeats:YES];
}
Any thoughts or insight would be greatly appreciated.
Upvotes: 1
Views: 558
Reputation: 21
Ahhh... Found it. It was within my personal template, meta viewport settings
I had to replace:
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
With this:
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, target-densityDpi=device-dpi" />
Fixed: :) - iOS 7 Compatibility.
Upvotes: 1