how can we fix rotation of screen in codenameone? - lwuit

I am making a application in code name one, and as my requirement I want my screen fix.
like only portrait view or landscape view. How we can do it?
Please help.

Try Display.getInstance().canForceOrientation() and Display.getInstance().lockOrientation(boolean). Notice that not all devices support orientation locking.

Related

Changing parameters on iOS device orientation

I have a Tabbar project in which one one the tabs should be on landscape mode. I've seen than the Tabbar controller only allows it only if all its views allow it. Son now I'm somehow forced to adapt all the views for both portrait and landscape mode, which I've never did before.
Am I right assuming that all should be done under:
-(void)willAnimateRotationToInterfaceOrientation...
so what happens with subview which are lazyly initialized? such as a footerView on a tableView?
Another thing is, I have a method to scroll the tableView so nothing is kept under the keyboard when it's called. The method uses a constant float + a variable. In landscape mode, the constant should be another.
Any feedback would be appreciated. Thanks in advance!
Read up on autoresizingmask - setting this attribute on your views will automate a lot of the orientation resizing.
And yes, you'll need a landscape and a portrait value for your constant.

UIImagePickerController differences from iPhone and iPad woes

I have an app designed for iPhone that makes use of the UIImagePickerController.
The app run in landscape only up until the image picker comes into view in its default portrait.
Problem 1:
On the iPhone when I rotate the device to portrait to view the image library the image picker view seems to do a flip as if rotating from landscape to portrait?
Problem 2:
I get the dreaded warning Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations.
Problem 3.
on the iPad when selecting an image the image picker is dismissed and the view is back in landscape but ...... if I then do anything that requires alert view or the keyboard they appear as if the device is in portrait? This does not happen on the iPhone???
I know problem 2 is a long running issue but please can anyone help with problems 1 & 3?
Thanks
number 3 resolved :-)
"The keyboard will show up in the orientation of the statusbar, which doesn't always change with rotations for some reason. So if you want to display that view only in landscape set [UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeLeft; or whichever orientation you want to prefer in your viewWillAppear method."

Iphone sdk custom uiview orientation issue

I am using custom based uiview controller with uitabbar contains uitableview. I am using image for cell background. I want to do orientation from portrait to landscape but the issue is it is not changing on orientation. I just want to know is there are any special thing for custom uiviewcontroller for orientation?
Thanks in advance
Regards,
sathish
If nothing happens when you rotate the device, you either have the system-wide rotation lock enabled (you checked that, right?), or your view controller isn't returning YES to the alternate orientation in its shouldAutorotateToInterfaceOrientation:, or you're doing something odd with your views that means your view controller isn't getting set as the “frontmost” one and thus isn't getting asked about orientation changes. It'll be easier to narrow that down if you post the code you're using to set up the controller and its view.

how to increase the orientation speed for iPad?

I'm using orientation for my application in iPad. i need to increase my orientation speed while i do the orientation(landscape, portrait, portrait upsidedown, landscape left, landscape right). but it little bit slow when orient the view can you please give the solution for my issue.
edit:
i have two controller landscape and portrait while orientation i just call the method for orientation and load the method
I got the solution sorry for not post the answer try to use the UIView as temp view and show that view while orientation is take place it looks pretty good to see... i solved it

UILabels don't look good in the landcsape mode

I am writing a game in the landscape mode. In *.plist I've set the "Initial interface orientation" option to "Landscape (left home button)". In Interface Builder my form seems good, with 2 labels are on the left and bottom.
But when I launch the app in simulator or in iphone that looks like the following
http://www.glowfoto.com/static_image/07-102041L/8907/png/09/2010/img4/glowfoto
Labels are on the top and rotated. Anyone knows what I am doing wrong and how to solve this?
I think your view controller's shouldAutorotateToOrientation method is not returning YES to landscape but to portrait orientations. But without code it's a guess in the wild.