Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-16-2010, 01:36 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 2
Jennifer is on a distinguished road
Wink hiding of web view after fast rotation

Hi All,

I am making an ipad application using webview on one of my viewController class where the data comes from the HTML.

While doing the fast rotation from landscapeLeft to landscapeRight or portraitLeft to portraitUpsideDown my view is not showing the webview containing the data comes from HTML but the image that i have placed on the background of the view is showing. The webview moves to the right side. To show the webview i need to scroll it from the right.

When i debug the application it goes properly in the - shouldAutorotateToInterfaceOrientationUIInterfac eOrientation)interfaceOrientation




- (BOOL)shouldAutorotateToInterfaceOrientationUIIn terfaceOrientation)interfaceOrientation
{



if (interfaceOrientation == UIInterfaceOrientationPortrait ||
interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown )
{
currentorientation=@"Portrait";
flag=TRUE;
[self updateLandscapeView];

NSLog(@"shoud ayto rotate portrait");
return UIInterfaceOrientationIsPortrait(interfaceOrientat ion);
}
else if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight )
{
currentorientation=@"Landscape";

[self updateLandscapeView];


NSLog(@"shoud ayto rotate landscape");
return UIInterfaceOrientationIsLandscape(interfaceOrienta tion);
}

return YES;
}
- (void)updateLandscapeView
{
UIScrollView *scrollView = [[myWebView subviews] lastObject];
[scrollView setContentSize:CGSizeMake(0,scrollView.contentSize .height)];

if([currentorientation isEqualToString:@"Landscape"])
{
[appDeleg setOrient:@"Landscape"];
[aboutImgView setFrame:CGRectMake(0, 0,1024, 768)];
aboutImgView.image = [UIImage imageNamed:@"bg1.png"];

[myWebView setFrame:CGRectMake(0, 0, 1024, 768)];

if(flag==FALSE)
{
myWebView.frame=CGRectMake(0, 0, 1024, 700);
flag=TRUE;
}
[self loadWebView];


}
//else if([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortrait | [[UIDevice currentDevice] orientation] == UIDeviceOrientationPortraitUpsideDown)
else if([currentorientation isEqualToString:@"Portrait"])

{
[appDeleg setOrient:@"Portrait"];

[aboutImgView setFrame:CGRectMake(0, 0,768, 1024)];
aboutImgView.image = [UIImage imageNamed:@"bg.png"];

[myWebView setFrame:CGRectMake(0, 0, 768, 1024)];

[self loadWebView1];

}

}


Hope a positive response from your side.








Jennifer
Attached Images
File Type: jpg 1-1.JPG (32.2 KB, 0 views)
Jennifer is offline   Reply With Quote
Reply

Bookmarks

Tags
ipad, orientation, webview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 334
19 members and 315 guests
2ndSegment, bignoggins, cayladv57, cgokey, dermotos, djohnson, Domele, guusleijsten, Hamad, heshiming, linkmx, markuschow, Objective Zero, pungs, Rudy, Sloshmonster, teebee74, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,655
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pungs
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:54 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0