Search Results

Search found 1353 results on 55 pages for 'orientation'.

Page 2/55 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Phonegap/Cordova orientation change Android 4

    - by user1477576
    I have a problem changing the orientation of the device (Android 4). In other versions it works fine. Versión of Cordova: cordova-1.8.0.js / cordova-1.8.1.js In Android 4 the app crash or show: "A network error occurred. (file:///android_asset/www/index.html)" I searched a lot about this and no answer solves the problem. In most cases users suggest adding: android:configChanges="orientation|keyboardHidden|screenSize" In other cases: super.setIntegerProperty("loadUrlTimeoutValue",60000); That not work for me :( My manifest activity: <activity android:name=".AppNameActivity" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden|screenSize"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> The application should run on Android 2.2 to 4. Thank you very much for the help.

    Read the article

  • Adding UIViewController.view to another view causes orientation problems

    - by Bob Vork
    Short version: I'm alloc/init/retaining a new UIViewController in one UIViewControllers viewDidLoad method, adding the new View to self.view. This usually works, but it seems to mess up orientation change handling of my iPad app. Longer version: I'm building a fairly complex iPad application, involving a lot of views and viewcontrollers. After running into some difficulties adjusting to the device orientation, I made a simple XCode project to figure out what the problem is. Firstly, I have read the Apple Docs on this subject (a small document called "Why won't my UIViewController rotate with the device?"), and while I do believe it has something to do with one of the reasons listed there, I'm not really sure how to fix it. In my test project I have an appDelegate, a rootViewController, and a UISplitViewController with two custom viewControllers. I use a button on the rootViewController to switch to the splitViewController, and from there I can use a button to switch back to the rootViewController. So far everything is great, i.e. all views adjust to the device orientation. However, in the right viewController of the splitViewController, I use the viewDidLoad method to initialize some other viewControllers, and add their views to its own view: self.newViewController = [[UIViewController new] autorelease]; [newViewController.view setBackgroundColor:[UIColor yellowColor]]; [self.view addSubview:newViewController.view]; This is where things go wrong. Somehow, after adding this view, adjusting to device orientation is messy. On startup everything is fine, after I switch to the splitViewController everything is still fine, but as soon as I switch back to the rootViewController it's all over. I have tried (almost) everything regarding retaining and releasing the viewcontroller, but nothing seems to fix it. As you can see from the code above, I have declared the newViewController as a property, but the same happens if I don't. Shouldn't I be adding a ViewController's view to my own view at all? That would really mess up my project, as I have a lot of viewControllers doing all sorts of things. Any help on this would be greatly appreciated...

    Read the article

  • Rotating a child shape relative to its parent's orientation

    - by user1423893
    When rotating a shape using a quaternion value I also wish rotate its child shape. The parent and child shapes both start with different orientations but their relative orientations should always be the same. How can I use the difference between the previous and current quaternions of the parent shape in order to transform the child segment and rotate it relative to its parent shape? public Quaternion Orientation { get { return entity.Orientation; } set { Quaternion previousValue = entity.Orientation; entity.Orientation = value; // Use the difference between the quaternion values to update child orientation } }

    Read the article

  • iPad device orientation is null?

    - by Brodie4598
    ([UIDevice currentDevice].orientation); using the above code in my app, all i get is 0 (unknown) is there something thats going wrong here? Seems pretty straightforward edit: more research led me to the problem with using device orientation early in the app, which I am doing. However when I instead use interfaceOrientation, it always returns 1 (portrait)

    Read the article

  • Suspend orientation change

    - by OkyDokyman
    Documentation says: "a configuration change (such as a change in screen orientation, language, input devices, etc) will cause your current activity to be destroyed, going through the normal activity lifecycle process of onPause(), onStop(), and onDestroy()." I would like to suspend the orientation change, since it crashes my app if it was done in the middle of a a loop (of reading a file). How can I do this? Also - looking for some kind of "onOrientationChnage" function :)

    Read the article

  • Android orientation change causes ImageView to dissapear

    - by Jarrod Smith
    Below is my layout for the row template in a SimpleCursorAdapter. The ImageView with id next_arrow disappears on orientation change. If I replace @drawable/arrow with @drawable/icon (copy of the standard sym_def_app_icon) it works fine. I thought it might be somehow related to the icons being of different dimensions, but I resized @drawable/icon to be the exact same dimensions as the arrow and it still worked fine while the arrow didn't. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="90dp" android:background="@drawable/product_list_divider" android:paddingTop="10dp"> <ImageView android:src="@drawable/ninja_20_65" android:id="@+id/category_icon" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_marginTop="3dp"/> <LinearLayout android:orientation="vertical" android:layout_weight="5" android:layout_width="0dp" android:layout_height="wrap_content"> <TextView android:id="@+id/category_name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Name" style="@style/CategoryHeading" android:layout_marginTop="5dp"/> <TextView android:id="@+id/category_description" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Description" style="@style/CategoryDescription"/> </LinearLayout> <ImageView android:src="@drawable/arrow" android:layout_weight="1" android:layout_width="0dp" android:layout_marginRight="10dp" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:id="@+id/next_arrow"/> </LinearLayout>

    Read the article

  • Android: Determine when an app is being finalized vs destroyed for screen orientation change

    - by Matt
    Hi all, I am relatively new to the Android world and am having some difficultly understanding how the whole screen orientation cycle works. I understand that when the orientation changes from portrait to landscape or vice versa the activity is destroyed and then re-created. Thus all the code in the onCreate function will run again. So here's my situation: I have an app that I am working on where it logs into a website, retrieves data, and displays it to the user. While this is all done in background threads, the code that starts these threads is in the onCreate function. Now, the problem lies in that whenever the user changes the screen orientation, the app will log in, retrieve the data, and display it to the user again. What I would like to do is set a boolean that tells the app if it is logged in or not so it knows whether or not it must log in when the onCreate function is called. So long as the app is in memory the HttpClient will exist and contain the cookies from logging the user in but when the app is killed by the system those will go away. So I would assume that I need to do something like setting the logged in boolean to false when the app is killed but since onDestroy is called when the screen is rotated how is this possible? I also looked into the finalize function and isFinishing() but those seem to not be working. Shorter version: How can I distinguish between when an app is being killed from memory from when an activity is being rotated and different code for each event? Any help or a point in the right direction is greatly appreciated. Thank you!

    Read the article

  • Positioning objects in views during re-orientation in iPad

    - by Arni
    iPad Gurus: Apple wants us to support all orientations. I take that to mean that a particular layout should either rotate so that all objects are positioned relatively the same OR, if that doesn't look good, then they ought to be repositioned, OR two views ought to be designed and built. If I rely on the built-in rotation mechanism, the objects either get resized or they straddle the edge of the page in one orientation or the other, or they disappear from view altogether. I can't seem to find the right settings to get the objects to align clearly so they are seen in each orientation. Repositioning leads to a lot of if statements in the View Controller. So I don't think Apple had that in mind. I tried replacing views and even view controllers in "willRotateToInterfaceOrientation" method, but that either causes crashes or the portrait views end up in landscape unexpectedly and vv. Moreover, two view controllers means double the coding for the same view. There must be proper way to handle orientation changes, but I have searched the internet and documentation and sample code in vain for something that works. How is this done properly? Thanks!

    Read the article

  • Windows Phone 7 applications - Orientation Change

    - by Peter Perhác
    Hello there fellow developers! I am working on a Windows Phone 7 app and I can't figure out what I believe is a simple problem for the more seasoned ones. Say I have a layout consisting of two elements: a ListBox (filled with an abundance of items) and a TextBlock (providing the user with some basic instructions). I want these to be one above the other when the device is in Portrait orientation and I want these to be next to each other when the device orientation changes to Landscape. For the Portrait orientation I am using a Grid layout manager, as it lets me define the rows' heights like so... row 0 Height="2*", row 1 Height="*" Listbox sits in row 0, TextBlock in row 1. Now, what would be really neat is to simple change the RowDefinitions into ColumnDefinitions and reassign the listbox/textblock to the grid's columns instead of rows for when the device switches into Landscape. But that's just my idea. I don't know how to get this done elegantly. Maybe there's a better approach to this? Or maybe this is the correct approach and there is some method built for exactly this purpose? Thank you for your suggestions!

    Read the article

  • DependencyProperty Orientation problem

    - by byte
    I am learning WPF and am trying to create my first UserControl. My UserControl consists of StackPanel StackPanel contains a Label and TextBox I am trying to create two Dependency Properties Text for the Label Orientation for the StackPanel - The orientation will affect the position of the Label and TextBox effectively I have successfully created a Text dependency property and bind it to my UserControls . But when I created the Orientation property, I seem to get following error in get property The as operator must be used with a reference type or nullable type ('System.Windows.Controls.Orientation' is a non-nullable value type) public static DependencyProperty OrientationProperty = DependencyProperty.Register("Orientation", typeof(System.Windows.Controls.Orientation), typeof(MyControl), new PropertyMetadata((System.Windows.Controls.Orientation)(Orientation.Horizontal))); public Orientation Orientation { get { return GetValue(OrientationProperty) as System.Windows.Controls.Orientation; } set { SetValue(OrientationProperty, value); } } Appreciate your help.

    Read the article

  • Android Image Orientation Issue on Motorola Droid

    - by roundhill
    Hi there, Our app uses the gallery pick action to grab an image from the device to upload to a new blog post. We're seeing on the Moto Droid that images taken in portrait are being sent back to the app in landscape orientation so the image is sideways. AFAIK this only occurs on the Droid. Found this via google, but we need the full size image to be uploaded in the correct orientation so the solution doesn't work for us: http://groups.google.com/group/android-developers/browse_frm/thread/1246475fd4c3fdb6?pli=1 An easy way to reproduce this is to take a picture in portrait on the Droid, then send it to yourself via Gmail. In the email message, the image will be in landscape (sideways). I've tested on the droid 2.1 update and the issue is still there.

    Read the article

  • iphone/ipad orientation handling

    - by Mark
    This is more of a general question for people to provide me guidance on, basically Im learning iPad/iPhone development and have finally come across the multi-orientation support question. I have looked up a fair amount of doco, and my book "Beginning iPhone 3 Development" has a nice chapter on it. But my question is this, if I was to programatically change my controls (or even use different views for each orientation) how on earth to people maintain their code base? I can just imagine so many issues with spaghetti code/thousands of "if" checks all over the place, that it would drive me nuts to make one small change to the UI arrangement. Does anyone have experience handling this issue? What is a nice way to control it? Thanks a lot Mark

    Read the article

  • iPad SDK, how to handle orientation with an UIImageView

    - by Salah
    Hello I'm developing an app for iPad and I try to handle multiple orientation. My app contains a webview and a loading UIImageView that appears when my webview is loading content. This UIImageView has a background image that I set in InterfaceBuilder. When I change orientation to landscape, the image is cut. I'd like the UIImageView to set image-portrait.png when the ipad is in portrait mode and image-landscape.png when it's in landscape mode. Thank you for your help and advices! Screenshots :

    Read the article

  • iPhone status bar orientation with opengl

    - by sfider
    I have opengl only view that displays in portrait and landscape mode using projection matrix (view's transformation is identity all the time). I need to show status bar with proper orientation. I do this by setting status bar orientation property in UIApplication and changing frame of opengl view so the view won't go under status bar. When I change from landscape to portrait (landscape is the initial state) view's frame is set to (0, 20, 320, 460) and stays like this. However view appears to be translated by (-10, -10). It seems that I did change the size of view but couldn't move it. Weird things are: initialy view is full screen, I change it to (0, 0, 300, 480) (landscape with status bar) and it works then, it doesn't work when I try to chenge it for the second time (portrait with status bar) frame property of the view shows that view is placed correctly Any thoughts on what can by the problem?

    Read the article

  • AVD Screen orientation not changing with CTRL+F11 or CTRL+F12

    - by Brad Hein
    I run my app in the AVD emulator using eclipse but I'm unable to change the screen orientation in the AVD (Android 2.0 platform on the emulator). When I press CONTROL+F11 or CONTROL+F12 on the keyboard, nothing happens. No messages are generated in the adb debuglog/logcat either when I press either hotkey. According to http://developer.android.com/guide/developing/tools/emulator.html these are the correct hotkeys to switch the emulator's screen orientation. I tried it with my app, and with the messaging app. The hotkey has no affect in any case. I'm running Fedora 12, Gnome. I checked my Keyboard Shortcuts in the System - Preferences menu, nothing's attached to either hotkey. Same problem, 3 different PCs (all running Fedora Gnome).

    Read the article

  • presentViewController or presentModalViewController not supporting orientation in iOS 6

    - by Prateek
    I am new to this technology. I am using this code if ([self respondsToSelector:@selector(presentViewController:animated:completion:)]) { [self presentViewController:navigationControllerCustom animated:YES completion:nil]; } else { [self presentModalViewController:navigationControllerCustom animated:YES]; } My application has two orientation Portrait and Portrait upside down. This code works well with iOS 5.1, but orientation does not work on iOS 6 I have also added this code on my navigationControllerCustom class - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown); } -(NSUInteger)supportedInterfaceOrientations { return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown); } Please help me to solve this issue. Thanks in advance.

    Read the article

  • Screen orientation change forces data re-entry

    - by Timbermar
    I'm developing a simple app, only a handful of activities and nothing to complicated. The issue I'm having is that in a few of my activities I have EditText widgets, and when the screen is rotated, these widgets loose their values. They still visually, that is, on the handset screen, report their values from before the rotation, but to the code report their default values. An example, I have an activity with an EditText, I enter a number, 15, the calculator starts calculating, displays a result. If at this point I rotate to a different orientation, as expected the activity dies, reloads, shows the new orientation, my value of 15 is still in the EditText, however the calculator (the code) calculates as if it was 0, which is the initial value. I have not tried changing the initial value to see if it is really pulling from the default value, or just setting itself to 0 when I cast it as an int. If I didn't explain this well enough, let me know, I can add source code if I need to. Thanks.

    Read the article

  • UIToolBar and iPhone Interface Orientation Problem

    - by Leo
    I am developing an application in iPhone. One view support orientation in portrait and landscape. I have two separate views for both orientation. This view has a UIToolbar at the top. Problem is when I change view back from landscape to portrait, UIToolbar at the top disappears. I want toolbar to come back in its original position when it is rotated back to portrait. This is what I am doing in my program. - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation duration:(NSTimeInterval)duration { if (interfaceOrientation == UIInterfaceOrientationPortrait) { self.view = self.portrait; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(0)); self.view.bounds = CGRectMake(0.0, 0.0, 300.0, 480.0); } else if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) { self.view = self.landscape; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(-90)); self.view.bounds = CGRectMake(0.0, 0.0, 460.0, 320.0); } else if (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) { self.view = self.portrait; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(180)); self.view.bounds = CGRectMake(0.0, 0.0, 300.0, 480.0); } else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) { self.view = self.landscape; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(90)); self.view.bounds = CGRectMake(0.0, 0.0, 460.0, 320.0); } } I don't know what am I missing here? Any help would be really appreciated.

    Read the article

  • Android - Dealing with a Dialog on Screen Orientation change

    - by Donal Rafferty
    I am overriding the onCreateDialog and onPrepareDialog methods or the Dialog class. I have followed the example from Reto Meier's Professional Android Application Development book, Chapter 5 to pull some XML data and then use a dialog to display the info. I have basically followed it exactly but changed the variables to suit my own XML schema as follows: @Override public Dialog onCreateDialog(int id) { switch(id) { case (SETTINGS_DIALOG) : LayoutInflater li = LayoutInflater.from(this); View settingsDetailsView = li.inflate(R.layout.details, null); AlertDialog.Builder settingsDialog = new AlertDialog.Builder(this); settingsDialog.setTitle("Provisioned Settings"); settingsDialog.setView(settingsDetailsView); return settingsDialog.create(); } return null; } @Override public void onPrepareDialog(int id, Dialog dialog) { switch(id) { case (SETTINGS_DIALOG) : String afpunText = " "; if(setting.getAddForPublicUserNames() == 1){ afpunText = "Yes"; } else{ afpunText = "No"; } String Text = "Login Settings: " + "\n" + "Password: " + setting.getPassword() + "\n" + "Server: " + setting.getServerAddress() + "\n"; AlertDialog settingsDialog = (AlertDialog)dialog; settingsDialog.setTitle(setting.getUserName()); tv = (TextView)settingsDialog.findViewById(R.id.detailsTextView); if (tv != null) tv.setText(Text); break; } } It works fine until I try changing the screen orientation, When I do this onPrepareDialog gets call but I get null pointer exceptions on all my variables. The error still occurs even when I tell my activity to ignore screen orientation in the manifest. So I presume something has been left out of the example in the book do I need to override another method to save my variables in or something?

    Read the article

  • How to deal with background image orientation in UIView

    - by docchang
    I'm using setting the background image using methodology below. When I rotate my device the background repeats, which make sense because it is not an image. How do I deal with orientation change if this is the way I'm setting my background image? - (void)viewDidLoad { [super viewDidLoad]; UIColor *background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"background.png"]]; self.view.backgroundColor = background; [background release]; }

    Read the article

  • Change UITableViewCell Height on Orientation Change

    - by Peter Zich
    I have a UITableView with cells containing variable-height UILabels. I am able to calculate the minimum height the label needs to be using sizeWithFont:constrainedToSize:lineBreakMode:, which works fine when the table view is first loaded. When I rotate the table view the cells become wider (meaning there are fewer lines required to display the content). Is there any way I can have the height of the cells redetermined by the UITableView during the orientation change animation or immediately before or after? Thank you.

    Read the article

  • Force iPhone Orientation

    - by user288225
    I'm making an iPad app and I need to force the orientation to portrait to several parts of the app. I used the undocumented "setOrientation" API and the app was rejected. Is there a documented way to do this?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >