How can I make my app look alike in both portrait and landscape view? - autolayout

This is my constraint
I have made use of auto layout in my app, all the UI elements are visible in portrait mode:
But the view is incomplete in landscape mode.
How can I make my app look alike in both portrait and landscape view?
I am using Swift 2 in Xcode7.2.

use autolayout With Sizeclasses.
read this artical

When handling screen with UITextField you should always use something scrollable, either a UIScrollView or a UITableView. By using, you can easily update your screen UI. I'm highly recommended not to use UIScrollView, UITableView will be more easy. And yes, there's one well maintained library (3rd party) https://github.com/michaeltyson/TPKeyboardAvoiding which will handle your tableview position when your textfield will get focus.

Related

Using Xamarin Forms, maintain aspect ratio of Navigation Page Title Icon in Landscape on iPhone X

When running a Xamarin Forms app that uses a TitleIcon on a Navigation Page, the image is squished when the device is turned to landscape mode. What do I need to do to maintain the aspect ratio of the image as it does with previous devices?
iPhone 8 Portrait:
iPhone 8 Landscape:
iPhone X Portrait:
iPhone X Landscape:
For these kinds of customizations, I think you might be better off avoiding the built in NavigationPage NavigationBar and instead implement your own navigationbar in XAML. It would be relatively simple to just use a grid or absolutelayout with your desired background color and image and place it at the top of your pages. You could use a control template or a reusable content view to avoid copying and pasting the bar to every page. Once you've got that done you just have to hide the default navigationbar by using
NavigationPage.SetHasNavigationBar(myPage, false);
Or by adding this to the top of your content page definition in XAML
NavigationPage.HasBackButton="False"
Something like this might help you get started:
http://lukealderton.com/blog/posts/2017/january/replacing-the-xamarin-headernavigation-bar-with-a-custom-viewtemplate/

Flex 4.6 Mobile force all views to portrait except one

I´m trying to do this for 2 days and no success.
One, and only one view (the video record view) I need to force to start in landscape. All the other views must start in portrait. And... Landscape view and the others portrait views must not rotate if the user rotates the device.
I´m trying with stage.setAspectRatio(StageAspectRatio.PORTRAIT) for portrait views and stage.setAspectRatio(StageAspectRatio.LANDSCAPE) for landscape view. Sometimes works... Sometimes not.
Sometimes going from a portrait to landscape works but when I return to the caller portrait view, its rotate to landscape too.
Thanks for some help.
If you didn't already, take a look at this article that should be really useful to you: StageAspectRatio Enhancements in AIR 3.3
You could of course play with setAspectRatio to define starting orientation, but that's only part of the problem.
You can modify the autoOrients property located in your app descriptor file if you want to get rid of the automatic behavior and handle everything manually.
Or you could listen for every orientationChanging event of the Stage object and preventDefault() them to cancel any screen orientation.
Once this is done, you simple have to handle the loading orientation of your views and this should be it.

Controlling transitions when Flex mobile changes between portrait and landscape

I'm developing a mobile application in Flex 4.6, and I have the autoOrient property set to true so that Flex takes care of changing between portrait and landscape mode when the phone is rotated. This works, but...
The transition between portrait and landscape consists of the application rotating from one position to the other and it doesn't look good at all. I would like to have Flex just cut or fade between the two screen orientations without rotating, but I can't find where I could control this.
My application is based on a ViewNavigatorApplication if that helps with the answer.
I guess what I'm looking for is something like the sort of control you can have when changing between views with something like:
navigator.defaultPushTransition = new FlipViewTransition();
but to do with portrait/landscape transitions instead.
You can listen to the orientation change event (StageOrientationEvent.ORIENTATION_CHANGE) and set a transition to your desired container.

Is there a way to use space between buttons in landscape

After much digging I've realised there is no Qt-way to use 3 middle buttons in landscape mode in S50v5, however I don't like to waste this precious space. I've tried to place my widgets there but menu bar is on top and widgets aren't visible.
Is there any way to utilise this space without using native Symbian APIs?
Controlling the stock softkeys in Qt is a pain. The strategy I have used is to make the QMainWindow full-screen with showFullScreen() which allows you to use the softkey space yourself. You will have to make sure any widgets you create are ultimately parents of the main window, and be mindful of this bug when creating pop-ups.

How to design a flash based website when user has different screen size and different resolution?

I am developing a flash based website using mxml. My monitor's resolution is 1280x768 and is widescreen. The problem is while it appears properly in my screen it doesn't appear properly in others. Which is the best approach to solve the problem ?
I have 2 in mind.
Let scrollbars take care of it : If the screen is 14 inch screen with
800x600 resolution it appears zoomed
in. So thats a problem
Get screen resolution and resize using scaleX and scaleY : The graphic
components will get resized but fonts
give problem.
Which is the best approach among these ? If there is a better approach please mention.
Thanks
The BEST approach for this is to create a fluent UI based on percentage and constraints.
This way, the UI will feel the same on all computers not just yours.
I would recommend to also use the flow container that comes as a part of flexLib because that way is the easiest to create a fluent design.
Not long ago I created an application for a forex company that was perfectly fit to all screens larger then 1280X800 (design definition).
It's not that hard to do once you get the hang of it.
Good luck.
You can add an event listener to the stage to this effect:
this.stage.addEventListener(Event.RESIZE, resizeHandler);
private function resizeHandler(e:Event):void {
var newWidth:Number = this.stage.stageWidth;
var newHeight:Number = this.stage.stageHeight;
// etc, roll from here to do your manual positioning logic.
}
Note that this should also work on any DisplayObject - so you can use constraints and percentages on your containers, but then intercept their auto-resizing with a setup like this which will let you fine-tune the appearance of their contents.
Personally I would develop the screen for 800x600 and then dynamically resize the screen for higher resolutions.
You can use vertical scrollbars but horizontal scrolling is a big no-no in my books. It takes away from the whole experience of your site and gets rather irritating.

Resources