Search Results

Search found 774 results on 31 pages for 'landscape'.

Page 9/31 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • ListView: convertView / holder getting confused

    - by Steve H
    I'm working with a ListView, trying to get the convertView / referenceHolder optimisation to work properly but it's giving me trouble. (This is the system where you store the R.id.xxx pointers in as a tag for each View to avoid having to call findViewById). I have a ListView populated with simple rows of an ImageView and some text, but the ImageView can be formatted either for portrait-sized images (tall and narrow) or landscape-sized images (short and wide). It's adjusting this formatting for each row which isn't working as I had hoped. The basic system is that to begin with, it inflates the layout for each row and sets the ImageView's settings based on the data, and includes an int denoting the orientation in the tag containing the R.id.xxx values. Then when it starts reusing convertViews, it checks this saved orientation against the orientation of the new row. The theory then is that if the orientation is the same, then the ImageView should already be set up correctly. If it isn't, then it sets the parameters for the ImageView as appropriate and updates the tag. However, I found that it was somehow getting confused; sometimes the tag would get out of sync with the orientation of the ImageView. For example, the tag would still say portrait, but the actual ImageView would still be in landscape layout. I couldn't find a pattern to how or when this happened; it wasn't consistent by orientation, position in the list or speed of scrolling. I can solve the problem by simply removing the check about convertView's orientation and simply always set the ImageView's parameters, but that seems to defeat the purpose of this optimisation. Can anyone see what I've done wrong in the code below? static LinearLayout.LayoutParams layoutParams; (...) public View getView(int position, View convertView, ViewGroup parent){ ReferenceHolder holder; if (convertView == null){ convertView = inflater.inflate(R.layout.pick_image_row, null); holder = new ReferenceHolder(); holder.getIdsAndSetTag(convertView, position); if (data[position][ORIENTATION] == LANDSCAPE) { // Layout defaults to portrait settings, so ImageView size needs adjusting. // layoutParams is modified here, with specific values for width, height, margins etc holder.image.setLayoutParams(layoutParams); } holder.orientation = data[position][ORIENTATION]; } else { holder = (ReferenceHolder) convertView.getTag(); if (holder.orientation != data[position][ORIENTATION]){ //This is the key if statement for my question switch (image[position][ORIENTATION]) { case PORTRAIT: // layoutParams is reset to the Portrait settings holder.orientation = data[position][ORIENTATION]; break; case LANDSCAPE: // layoutParams is reset to the Landscape settings holder.orientation = data[position][ORIENTATION]; break; } holder.image.setLayoutParams(layoutParams); } } // and the row's image and text is set here, using holder.image.xxx // and holder.text.xxx return convertView; } static class ReferenceHolder { ImageView image; TextView text; int orientation; void getIdsAndSetTag(View v, int position){ image = (ImageView) v.findViewById(R.id.pickImageImage); text = (TextView) v.findViewById(R.id.pickImageText); orientation = data[position][ORIENTATION]; v.setTag(this); } } Thanks!

    Read the article

  • Trouble with datasource not being called from viewWillAppear

    - by user278859
    A little background. I have taken GCCalendar which only works in portrait orientation and extended it to work in landscape similar to how the iPhone's Calendar app works. I did this by duplicating the main view class and modifying it to work in landscape. So when the phone is in portrait orientation the CGCalendar is instantiated from the apps main view controller using the original portrait view class and when in landscape orientation using the new modified landscape view class. Most of the other classes in GCCalendar are shared without modification. A few had to be duplicated as well. I got it all working great except for an issue with the datasource. The datasource is called when the calendar is first loaded and each time the user changes the dates being viewed. Problem is I can't get the datasource call to work on the first call. I am stumped as it works fine in portrait orientation and I cannot find any difference between the 2 versions. Following is some of the code that shows how it gets to the datasource call the first time. Subsequent calls removes all the calendar subviews and instantiates them again with the new dates. The duplicated landscape class names end in LS. Otherwise as you can see they are identical. Does anyone has any idea of where else I might look to resolve this issue? Thanks, John -------------------------------- //App main view controller - (void)showLandscapeCalendar { GCCalendarLandscapeView *calendar = [[[GCCalendarLandscapeView alloc] init] autorelease]; calendar.dataSource = self; calendar.delegate = self; navigationController = [[UINavigationController alloc] initWithRootViewController:calendar]; [self presentModalViewController:navigationController animated:YES]; } - (void)showPortraitCalendar { GCCalendarPortraitView *calendar = [[[GCCalendarPortraitView alloc] init] autorelease]; calendar.dataSource = self; calendar.delegate = self; navigationController = [[UINavigationController alloc] initWithRootViewController:calendar]; [self presentModalViewController:navigationController animated:YES]; } - (NSArray *)calendarEventsForDate:(NSDate *)date{ //build and return the events array //this is the protocol datasource method //It is supposed to run every time the date changes in the calendar } ------------------------------- // GCCalendarLandscapeView... - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if (viewDirty) { [self reloadDayAnimated:NO context:NULL]; viewDirty = NO; } viewVisible = YES; } - (void)reloadDayAnimated:(BOOL)animated context:(void *)context { GCCalendarDayViewLS *nextDayView = [[GCCalendarDayViewLS alloc] initWithCalendarView:self]; } ------------------------------- //GCCalendarDayViewLS - (id)initWithCalendarView:(GCCalendarView *)view { if (self = [super init]) { dataSource = view.dataSource; } return self; } - (void)reloadData { //** first time through the dataSource method does not run events = [dataSource calendarEventsForDate:date]; } ------------------------------- // GCCalendarPortraitView... - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if (viewDirty) { [self reloadDayAnimated:NO context:NULL]; viewDirty = NO; } viewVisible = YES; } - (void)reloadDayAnimated:(BOOL)animated context:(void *)context { GCCalendarDayView *nextDayView = [[GCCalendarDayView alloc] initWithCalendarView:self]; } ------------------------------- //GCCalendarDayView - (id)initWithCalendarView:(GCCalendarView *)view { if (self = [super init]) { dataSource = view.dataSource; } return self; } - (void)reloadData { **//this one works every time events = [dataSource calendarEventsForDate:date]; }

    Read the article

  • How to handle iPad Modal View rotation

    - by Farha Ansari
    Hi, I have 2 views, each for portrait and landscape. I start by displaying the portrait view. On both the views, I have a button, which presents a modal view on clicking it. When the modal view comes up and then I rotate the iPad, the portrait view is replaced by the landscape view, but the modal view goes behind this view. Any idea how to bring the modal view again to the front after the rotation? Thanks for the help Farha

    Read the article

  • iPad: Tables in Popover Views do not Scroll to Show Selected Row

    - by mahboudz
    I am having two problems with viewcontrollerss in landscape orientation on the iPad. (1) I have two popups which hold tables. The tables should scroll to a specific row to reflect a selection in the main view. Instead, the tables do scroll down some but the actual selected row remains off screen. (2) All my action sheets come up with a width of 320. In Interface Builder, all my views are created in landscape orientation. Only the main Window is not, but I don't see a way to change that. My Configuration: Upon launch, I get the following coordinates for my main window and the main viewcontroller view: Window frame {{0, 0}, {768, 1024}} mainView frame {{0, 0}, {748, 1024}} All other views after that show these coordinates when summoned (when loaded but before being presented): frame of keysig {{0, 0}, {1024, 768}} frame of instrumentSelect {{20, 0}, {1024, 768}} frame of settings {{0, 0}, {467, 300}} In all my viewControllers, i respond to shouldAutorotateToInterfaceOrientation with: return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight)); Everything (almost) functions as expected. The app launches into one of the two landscape modes. The views (and viewcontrollers) display everything where it belongs and taps work all across the screen as expected. However, I still have the two problems. Problem 1: I have two popups containing tables long enough to run off screen. The tables should scroll to a selected row. They do scroll i.e. they don't start visually at row 1 but they don't scroll enough to actually show the selected row. It almost seems like a UITable internal rect gets created with the wrong number and stays that way but I've checked both of the UITableView's scrollView content coordinates and they seemed reasonable. Problem 2: I think this is related to problem 1 because my actionsheets come up with a width of 320. I can only assume that the iPad allows actionSheets in only 320 or 480 widths and since it somehow thinks that the screen is oriented in portrait mode, it uses the narrower width. There you have it. I can't believe I am still getting hung up on orientation issues. I swear Apple doesn't make it easy to have a landscape app. Any ideas?

    Read the article

  • programmatically change device orientation in iphone

    - by iPhoneDev
    I have navigation based app, when I click on any row in root view, the next view should come in Landscape mode. I am not able to find a proper way to implement this. What I tried is: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return UIInterfaceOrientationIsLandscape(interfaceOrientation); } But this is not working. The view should open only in Landscape mode (not when user rotate it). Can any one help me. Thanks

    Read the article

  • admob orientation problem in android

    - by Aswan
    Hi folks my application integrated with admob ads.when i change the orientation it should fit the screen depends on orientation.portrait mode it is working fine when i changed to landscape mode what ad size i am getting in portrait mode same size of ad displayed in landscape mode the following i am adding in layout page <com.admob.android.ads.AdView android:id="@+id/ad" android:layout_width="fill_parent" android:layout_height="wrap_content" myapp:backgroundColor="#000000" myapp:primaryTextColor="#FFFFFF" myapp:secondaryTextColor="#CCCCCC" />

    Read the article

  • Help - Getting wrong orientation

    - by barbgal
    Hi all, I am having one issue in my application which drives me mad... In my application, i rotate the simulator to the landscape mode but in my below function i get portrait orientation... what is the problem here. Pls help me out -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if ( interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown ) { NSLog(@" portrait orientation"); } else { NSLog(@"Landscape"); } }

    Read the article

  • XNA Track rotated pixel positions

    - by jonny adams
    Hi, Im making a game in xna where a tank has to move over a landscape. I need to be able find the bottom of the tank when it is rotated so I can make it move up and down as the player goes over the landscape. for example if i have a sprite at with its top left corner at 400,300 and i rotate it around its center by 45 degrees around its center, how do i find the new locations of the bottom track. Thanks

    Read the article

  • A question related to UITextfield

    - by user217572
    I have UITextfiled created dynamically by code I want to move keyboard up on click of UITextfield It should be set wether the return button of UITextfield press or not? and also it will be set whenever i move from portrait to landscape or landscape to portrait mode

    Read the article

  • android layout-land and screen-rotation handling

    - by davs
    I have layouts for portrait mode (in folder layout) and for landscape one (in the folder layout-land). This screen is located under one of the tabs, so I had to handle screen rotating (after screen has been rotated, no default screen restart occurs). I would like to update view from 'layout-land' when screen rotates to landscape mode and from 'layout' when screen rotates to portrait one. How can I do this?

    Read the article

  • Android Camera exit rotate

    - by John
    I am first time to write a camera app. At program, I am using setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) and android:screenOrientation="landscape" in Manifest to set the landscape screen. My problem is when use System.exit() or Intent. The screen will change to portrait automatically. But in my program, it haven't set any screen orientation again. How can I prevent this problem? Thanks!!

    Read the article

  • Detect orientation change, when only portrait is allowed on Android

    - by bicska88
    I have to solve the following: I have an Activity which's android:screenOrientation="portrait". Even though, when the device is rotated to landscape while this Activity is visible, I have to start another one, and, when the device is rotated back to portrait, I have to finish() the activity in landscape. I tried to perform this with a BroadcastReceiver, but this special activity doesn't receive any broadcasts because of the android:screenOrientation="portrait". Any help is well appreciated. Thanks.

    Read the article

  • iPhone OpenGL scrolling background jumps when texture is drawn for first time

    - by Magnum39
    I have been fighting a problem for a while now and would appreciate any help anybody could give. I have a sprite that moves within a landscape. The sprite remains in the center of the screen and the background moves to simulate that the sprite is moving within the landscape. I have split the landscape into sections so that I only draw the sections of the landscape that I need (are on screen). The Problem: As a new texture section of the screen appears on the screen (is drawn for the first time) the movement jumps. Almost like a frame is missed. I have done some timing experiments and I do not thinks a frame is missed. My processing is well below the 30fps that I have the animation set to. It only happens the first time the texture section is drawn. Is there something extra that is done the first time a texture is drawn? Here is the code: - (void) render{ // Sets up an array of values to use as the sprite vertices. const GLfloat sVerts[] = { -1.6f, -1.6f, 1.6f, -1.6f, -1.6f, 1.6f, 1.6f, 1.6f, }; static const GLfloat sTexCoords[] = { 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0 }; glDisableClientState(GL_COLOR_ARRAY); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); // Setup opengl to draw the object in correct orientation, size, position, etc glLoadIdentity(); // Enable use of the texture glEnable(GL_TEXTURE_2D); glVertexPointer(2, GL_FLOAT, 0, sVerts); glTexCoordPointer(2, GL_FLOAT, 0, sTexCoords); // draw the texture // set the position of the first tile float xOffset = -4.8; float yOffset = 4.8; int i; int y; int currentTexture = textureA; for(i=0; i<2; i++) { for(y=0; y<2; y++) { // test for the texture tile on the screen if not on screen then do not draw float localX = xOffset+(3.21*y); float localY = yOffset-(3.21*i); float xDiff = monkeyX - localX; float yDiff = monkeyY - localY; if(((xDiff < 3.2) && (xDiff > -3.2)) && ((yDiff <2.7) && (yDiff > -2.7))) { // bind the texture and set the vertex data pointers glBindTexture(GL_TEXTURE_2D, spriteTexture[currentTexture]); // move to draw position for the texture glLoadIdentity(); glTranslatef((localX+self.positionX), (localY+self.positionY), 0.0); //draw the texture glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } currentTexture++; } } }

    Read the article

  • How do I rotate only some views when working with a uinavigationcontroller as a tab of a uitabbarcon

    - by maxpower
    Here is a flow that I can not figure out how to work. ( when I state (working) it means that in that current state the rules for orientation for that view are working correctly) First View: TableView on the stack of a UINavigationController that is a tab of UITabBarController. TableView is only allowed to be portrait. (working) When you rotate the TableView to landscape a modal comes up with a custom UIView that is like a coverflow (which i'll explain the problem there in a moment). A Selection made on tableview pushes a UIScrollview on to the stack. UIScrollView is allowed all orientations. (working) When UIScrollView is in landscape mode and the user hits back they are taken to the custom UIView that is like the coverflow and only allows landscape. The problem is here. Because the UIScrollView allows full rotation it permitted the TableView to rotate as well to landscape. I have a method attached to a notification "UIDeviceOrientationDidChangeNotification" that checks to see if the custom view is the current controller and if it is and if the user has rotated back to portrait I need to pop the custom view and show the table view. The table view has to rotate back to portrait, which really is okay as long as the user doesn't see it. When I create custom animations it works pretty good except for some odd invisible black box that seems to rotate with the device right before I fade out the customview to the tableview. Further inorder to ensure that my tableview will rotate to portrait I have to allow the customview to support all orientations because the system looks to the current view (in my code) as to whether or not that app is allowed to rotate to a certain orientation. Because of this I many proposed solutions will show the customview rotating to portrait as the table view comes back to focus. My other problem is very similar. If you are viewing the tableview and rotate the modalview of the customview is presented. When you make a selection on this view it pushes the UIScrollview onto the stack, but because the Tableview only supports portrait the UIScrollview comes in in portrait while the device is in landscape mode. How can I overcome these awful blocks? This is my current attempt: When it comes to working with UITabBarController the system really only cares what the tabbarcontroller has to say about rotation. Currently whenever a view loads it reports it supported orientations. TabBarController.m - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { switch (self.supportedOrientation) { case SupportPortraitOrientation: [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; return (interfaceOrientation == UIInterfaceOrientationPortrait); break; case SupportPortraitUpsideDownOrientation: [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; return (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown); break; case SupportPortraitAllOrientation: [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown); break; case SupportLandscapeLeftOrientation: [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft); break; case SupportLandscapeRightOrienation: [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); break; case SupportLandscapeAllOrientation: [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); break; case SupportAllOrientation: if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) { [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; }else { //[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; } return YES; break; default: return (interfaceOrientation == UIInterfaceOrientationPortrait); break; } } This block of code is part of my UINavigationController and is in a method that responds to the UIDeviceOrientationDidChangeNotification Notification. It is responsible for poping the customview and showing the tableview. There are two different versions in place that originally were for two different versions of the SDK but both are pretty close to solutions. The reason the first is not supported on 3.0 is for some reason you can't have a view showing and then showen as a modal view. Not sure if that is a bug or a feature. The second solution works pretty good except that I see an outer box rotating around the iphone. if ([[self topViewController] isKindOfClass:FlowViewController.class]) { NSString *iphoneVersion = [[UIDevice currentDevice] systemVersion]; double version = [iphoneVersion doubleValue]; if(version > 3.0){ //1st solution //if the delivered app is not built with the 3.1 SDK I don't think this will happen anyway //we need to test this [self presentModalViewController:self.flowViewController animated:NO]; //[self toInterfaceOrientation:UIDeviceOrientationPortrait animated:NO]; [self popViewControllerAnimated:NO]; [self setNavigationBarHidden:NO animated:NO]; [self dismissModalViewControllerAnimated:YES]; }else{ //2nd solution DLog(@"3.0!!"); //[self toInterfaceOrientation:UIDeviceOrientationPortrait animated:NO]; CATransition *transition = [CATransition animation]; transition.duration = 0.50; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionPush; transition.subtype = kCATransitionFade; CATransition *tabBarControllerLayer = [CATransition animation]; tabBarControllerLayer.duration = 0.50; tabBarControllerLayer.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; tabBarControllerLayer.type = kCATransitionPush; tabBarControllerLayer.subtype = kCATransitionFade; [self.tabBarController.view.layer addAnimation:transition forKey:kCATransition]; [self.view.layer addAnimation:transition forKey:kCATransition]; [self popViewControllerAnimated:NO]; [self setNavigationBarHidden:NO animated:NO]; } [self performSelector:@selector(resetFlow) withObject:nil afterDelay:0.75]; } I'm near convinced there is no solution except for manual rotation which messes up the keyboard rotation. Any advice would be appreciated! Thanks.

    Read the article

  • Forcing UIInterfaceOrientation changes on iPhone

    - by Andiih
    I'm strugging with getting an iPhone application which requires just about every push or pop in the Nav Controller Stack to change orientation. Basically the first view is portrait, the second landscape the third portrait again (Yes I know this is less than ideal, but that's the design and I've got to implement it). I've been through various advice on here.... http://stackoverflow.com/questions/995723/how-do-i-detect-a-rotation-on-the-iphone-without-the-device-autorotating http://stackoverflow.com/questions/1824682/force-portrait-orientation-on-pushing-new-view-to-uinavigationviewcontroller http://stackoverflow.com/questions/181780/is-there-a-documented-way-to-set-the-iphone-orientation But without total success. Setting to link against 3.1.2 my reading of the linked articles above seems to indicate that if my portrait view pushes a view with - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return ((interfaceOrientation == UIInterfaceOrientationLandscapeRight) ); } Then then that view should appear rotated to landscape. What happens is it appears in its "broken" portrait form, then rotates correctly as the device is turned. If I pop the controller back to my portrait view (which has an appropriate shouldAutoRotate...) then that remains in broken landscape view until the device is returned to portrait orientation. I've also tried removing all the shouldautorotate messages, and instead forcing rotation by transforming the view. This kind of works, and I've figured out that by moving the status bar (which is actually hidden in my application) [UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeRight; the keyboard will appear with the correct orientation when desired. The problem with this approach is that the status bar transform is weird and ugly when you don't have a status bar - a shadow looms over the page with each change. So. What am I missing. 1) Am I wrong in thinking that in 3.1.2 (or possibly earlier) shouldAutorotateToInterfaceOrientation should provide the desired orientation simply by pushing controllers ? 2) Is there another way of getting keyboards to appear in the correct orientation. 3) Are the undocumented API calls the way to go (please no!)

    Read the article

  • Reset scale/width/zoom of Safari on iPhone using JavaScript/onorientationchange

    - by dwarbi
    I am displaying different content depending on how the user is holding his/her phone using the onorientationchange call in the body tag. This works great - I hide one div while making the other visible. The div in portrait mode looks great on first load. I use this to get the right scale/zoom: <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;" /> Even if the content in portrait mode run over, the width is correct and the user can scroll down. The display in landscape mode is perfect too. However, if content in landscape mode requires the user the scroll down, then when the user returns to portrait mode, the screen is "zoomed out" so to speak. This happens whether or not the user scrolled down while in landscape mode. I've tried many different things to try to get the scale/zoom/width of the screen right, but no luck. Is there any way to do this? Thanks in advance!

    Read the article

  • shouldAutorotateToInterfaceOrientation called several times in a row without any rotation

    - by Mike
    I am trying to implement some interface changes in my app, based on the device rotation. My app is a view based app. So, its main view controller has a didload method. The app starts in portrait. Almost all changes on the device orientation triggers the shouldAutorotateToInterfaceOrientation method but this method is not called when the device is put on portrait, after coming from any landscape orientation. While debugging the app, I have put a NSLog(@"orientation=%d", interfaceOrientation); on my shouldAutorotateToInterfaceOrientation method, and what I see is quite strange: When I run the app, shouldAutorotateToInterfaceOrientation is called 6 times before the app's interface even appears. Every time it runs, it reports a different number for the orientation: the order it reports on console is: portrait, portrait, portrait, landscape right, landscape left, upside down) (????). During this time the app is just beginning. All 6 times the debugger reports the method being run by the app's delegate. So, here comes the questions: WHy shouldAutorotateToInterfaceOrientation is not being called when the device enters on portrait? Why is this method running 6 times called by the delegate even before the app starts and shows its interface if no rotation is being done? thanks.

    Read the article

  • UIView rotation, modal view lanscape and portrait, parent fails to render

    - by Ben
    Hi everyone, I've hit a bit of a roadblock with something that I hope that someone in here can help me out with. I'll describe the 'state of play' first, and then what the issue is, so here goes; I have a series of view controllers that are chained together with a Navigation Controller (this works just fine), All of these view controllers support portrait mode only (by design), In one of the view controllers (the 'end' one actually) the user can click a table cell to pop up a modal view controller (using presentModalViewController(...) of course) This modal view controller supports portrait and landscape modes (and this works), When the user clicks the 'Done' button on this modal view controller we pop and pass control back to the parent view controller, however; If the user is in portrait mode when they click 'Done' then the parent displays itself just fine, If the user is in landscape mode when they click 'Done' then the parent displays a totally white, blank screen (that covers the whole screen). It is as if the controller does not know how to render in landscape and just doesn't bother. I'd like to be able to have this parent view render in portrait no matter what the orientation of the phone is when the user clicks the 'Done' button. Various forum posts suggest using the UIDevice method 'setOrientation' (but this is undocumented and will get our app rejected apparently). Another suggestion was to set the 'statusBarOrientation' to portrait in the 'viewWillAppear' method but that had no effect. So I am a bit stuck! Has any encountered anything like this before? If need be I can provide code, if that will help anyone diagnose the problem for me. Thanks in advance! Cheers, Ben

    Read the article

  • How do I reset the scale/zoom of a web app on an orientation change on the iPhone?

    - by Elisabeth
    I'm having the same problem that a couple of others have had with getting the correct behavior in a web app on an orientation change, and there doesn't seem to be an obvious solution - I've seen this question asked a couple of times on Stack Overflow and no one's yet been able to answer it. When I start the app in portrait mode, it works fine. Then I rotate into landscape and it's scaled up. To get it to scale correctly for the landscape mode I have to double tap on something twice, first to zoom all the way in (the normal double tap behavior) and again to zoom all the way out (again, the normal double tap behavior). When it zooms out, it zooms out to the correct NEW scale for landscape mode. Switching back to portrait seems to work more consistently; that is, it handles the zoom so that the scale is correct when the orientation changes back to portrait. I am trying to figure out if this is a bug? or if this is something that can be fixed with Javascript? With the viewport meta content, I am setting the initial-scale to 1.0 and I am NOT setting minimum or maximum scale (nor do I want to). I am setting the width to device-width. Any ideas? I know a lot of people would be grateful to have a solution as it seems to be a persistent problem. Thank you!

    Read the article

  • Modal view becomes partly transparent when dismissing?

    - by Jaanus
    A completely ordinary setup: UIViewController where I push another UIVC: BlahVc *blah = [[BlahVc alloc] initWithNibName:@"Blah" bundle:nil]; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:blah]; blah.delegate = self; [self presentModalViewController:nav animated:YES]; [nav release]; [blah release]; Details about Blah: to support both landscape and portrait with least effort, I built Blah.xib so that inside Blah's main view, call it view A, there is another view B, with width fixed to 320px, that positions itself in the centre of the screen. With portrait iPhone it fills up the whole screen, with landscape there are margins on the side. So far, so good. Autorotate etc works well. Now, to dismiss blah, I use the recommended setup: inside Blah, I do: [self.delegate blahDidCancel:self]; And in the parent VC, I have: - (void)blahDidCancel:(Blah *)blah { [self dismissModalViewControllerAnimated:YES]; } Both view A's and B's backgrounds are opaque white. Problem: as soon as it hits the dismissModalViewControllerAnimated line, view A seems to become transparent, while view B remains white. This is not a problem in portrait since view B still fills up the screen. But in landscape, the result is that view B is still opaque, but has see-through transparent margins on the side (where view A used to be that has now mysteriously become transparent), from where the parent view contents comes through during the dismissing animation. Why does it seem like view A becomes transparent upon dismissing the modal VC?

    Read the article

  • Fixing parent controller's elements after screen orientation

    - by Jonas Anderson
    I have a tab bar application with mixed orientation support for only some views. One of the child view controller shown from one of the tab's navigation controller is displayed only in Landscape mode. In order to accomplish this, I've done the view transformation for the child view as suggested here: Is there a documented way to set the iPhone orientation? The only problem I'm seeing is that after I've performed the orientation adjustment for the child controller and then readjusted orientation back to normal on its dismissal, the contents of the (parent) navigation controller is still shown with Landscape mode dimensions despite the navigation controller reporting the correct value for the interfaceOrientation. How do I ensure that view's size is reset to match the orientation without hardcoding screen dimensions? I have the following in the root navigation controller's viewWillAppear (invoked after the child controller is dismissed): - (void)viewWillAppear:(BOOL)animated { NSLog(@"viewFrame: (%2f, %2f), width: %2f, height: %2f\n", self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height); // Frame values are (0, 0) for (x,y) width: 320, height: 367 before I // displayed child controller. // Frame values are (0,0) width: 480, height: 219 after returning from child // controller -- still has the landscape dimensions NSLog(@"orientation: %d", self.interfaceOrientation); // reports portrait as expected } I've tried to invoke 'layoutIfNeeded' as well as 'setNeedsDisplay' on the view but neither of them bring the view contents into the correct display. Any suggestions would be greatly appreciated.

    Read the article

  • Is there a difference between starting an application from the OS or from adb

    - by aruwen
    I do have a curious error in my application. My app crashes (don't mind the crash, I roughly know why - classloader) when I start the application from the OS directly, then kill it from the background via any Task Killer (this is one of the few ways to reproduce the crash consistently - simulating the OS freeing memory and closing the application) and try to restart it again. The thing is, if I start the application via adb shell using the following command: adb shell am start -a android.intent.action.MAIN -n com.my.packagename/myLaunchActivity I cannot reproduce the crash. So is there any difference in how Android OS calls the application as opposed to the above call? EDIT: added the manifest (just changed names) <?xml version="1.0" ?> <manifest android:versionCode="5" android:versionName="1.05" package="com.my.sample" xmlns:android="http://schemas.android.com/apk/res/android"> <uses-sdk android:minSdkVersion="7"/> <application android:icon="@drawable/square_my_logo" android:label="@string/app_name"> <activity android:label="@string/app_name" android:name="com.my.InfoActivity" android:screenOrientation="landscape"></activity> <activity android:label="@string/app_name" android:name="com.my2.KickStart" android:screenOrientation="landscape"/> <activity android:label="@string/app_name" android:name="com.my2.Launcher" android:screenOrientation="landscape"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/></manifest> starting the com.my2.Launcher from the adb shell

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >