Strategies for Handling Multiple Screen Resolutions and Aspect Ratios in Web Development

Strategies for Handling Multiple Screen Resolutions and Aspect Ratios in Web Development

I know this would be a somewhat controversial opinion, but I'd say it anyway: Don't

Don't design for multiple screen sizes or aspect ratios. There are of course a few exceptions: Heavy web applications like webmail clients can definitely do with more screen real estate, and are probably flexible enough to accommodate a large range of screen sizes anyway. Mobile versions of said website, with a more flexible design to accommodate the incredible spectrum of mobile screen sizes can help too for sites with high mobile volumes. However, if you stick to the so called 'desktop web', then I think we can say that 95% of the time there are more important things to care about than screen sizes, resolution and aspect ratio.

First off, lets tackle the easy one. I don't really understand why you would care so much for aspect ratio - it isn't like we care that much for the 'below the fold' nonsense anymore, do we? The web is a vertical medium - scrolling will always have a place in websites. Having everything above the magical 600px line is just stupid.

Next, screen resolution/size: Again, I find it difficult to defend.

Users with large screens do not usually maximize their browser windows, because they find that most website do not take advantage of them. While the web adjust to the user, the user also adjust to the web. Although you could argue that this is a chicken and egg problem, the fact remains that website are usually designed for the lowest common denominator. I'm not defending this position, but rather, pointing it out as the current prevailing trend in the industry.

There are certain things that simply won't work with resolution that are too high or too low. There is, for example, a small range of widths that allow people to read comfortably on screen. Any longer and the amount of movement for the eye to the next line would be annoying. Too low and the text would appear cramped. The fact that the web was designed to be resolution neutral means that paradoxically not many provisions has been made for those who wish to build fluid layouts. min-height and max-height would help, of course, but the wider the range, the more difficulties you will face. Things like orphaned elements, displaced images, backgrounds that run out, etc. are unavoidable for truly flexible sites built with today's technology.

So my opinion is that the simplest method for dealing with multiple resolutions is to ignore it altogether - with today's technology there are not many options anyway - and design for the lowest common denominator.

Multiple screen resolutions/aspect ratios (games)

I found a clear answer to the problem.

Minimum resolutions are undefined prior to 3.0.
So for 3.0 and above it will be possible to choose a minimum resolution, design a game based on it and grow the layout dynamically on larger screens/ratios as mentioned by superM and others.

As you design your UI for different screen sizes, you'll discover that
each design requires a minimum amount of space. So, each generalized
screen size above has an associated minimum resolution that's defined
by the system. These minimum sizes are in "dp" units—the same units
you should use when defining your layouts—which allows the system to
avoid worrying about changes in screen density.

  • xlarge screens are at least 960dp x 720dp
  • large screens are at least 640dp x 480dp
  • normal screens are at least 470dp x 320dp
  • small screens are at least 426dp x 320dp

Note: These minimum screen sizes were not as well defined prior to
Android 3.0
, so you may encounter some devices that are mis-classified
between normal and large. These are also based on the physical
resolution of the screen, so may vary across devices—for example a
1024x720 tablet with a system bar actually has a bit less space
available to the application due to it being used by the system bar.

Source

how to handle different screen sizes in react native?

Have you designed the app using fixed widths and heights? You should definitely use the capabilities of flexbox and try to avoid settings fixed sizes as much as possible. The flex property can be used to define how much space a <View /> should use releative to others, and the other properties on that page can be used to lay out elements in a flexible way that should give the desired results on a range of different screen sizes.

Sometimes, you may also need a <ScrollView />.

When you do need fixed sizes, you could use Dimensions.get('window').

css for different screen resolutions?

Media queries is a good choice for your problem.

You don't have to use different classes for these, just you have to define different behaviour based on resolution.

You can know the screen height and width by Javascript, but with CSS, I dont think that is possible. The best you can do with css is to define range of devices as in Mobiles, Tablets, Laptops, Really Large screen Devices and based on media queries you can define what a class do on certain type of device.

Have a look a below example:

/* For Mobile */
@media screen and (max-width: 540px) {
.view {
width: 400px;
}
}

/* For Tablets */
@media screen and (min-width: 540px) and (max-width: 780px) {
.view {
width: 600px;
}
}

Actual dimensions can vary as per your case.

This is the same method many framework uses to implement responsiveness.

testing web under various resolutions

Here are just a few of several tools available:

  • http://quirktools.com/screenfly/

  • http://resizemybrowser.com/

  • http://responsivepx.com/

  • http://mattkersley.com/responsive/

Different CSS for different screen size?

<link rel="stylesheet" media="all" href="css/common.css">
<!--Responsive style sheets -->
<link rel="stylesheet" media="all and (min-width: 600px) and (max-width: 800px)" href="css/name1.css">
<link rel="stylesheet" media="all and (min-width: 480px) and (max-width: 640px)" href="css/name2.css">

How does screen resolution effect design of a mobile web application?

Both physical screen size and resolution are important when designing a mobile web site.

Screen size is important because it will define how much content can be placed on the website and also define how big your hit areas can be (essential for touch input devices).

Resolution will determine the amount of detail you can have on your page, this affects things like graphics.

A few suggestions as to how you can make your website work well across a range of devices:

  • Resize graphics to fit each device that your site is requested from. This will ensure that the presentation is consistent across most devices.
  • Favor flexible sizes for elements on your page - use percentages as opposed to fixed dimensions and specify text sizes in relative sizes.


Related Topics



Leave a reply



Submit