I want to design spesific layout for Nexus 5 dimensions. Because it is working with xxhdpi but this layout also working in pixel 3A. Therefore I want to design a layout and it will just work Nexus 5 dimensions ? How could I do it ?
Related
I have a Layout-sw400dp(among others) folder in my layouts folder for supporting different screens. The layout I have designed works fine for Pixel and other devices but it doesn't work for Pixel 2 XL, from what I've learned Pixel and Pixel 2 XL have the same width but different height.
I want to design a layout for Pixel 2 XL devices, I tried different things but it's not helping. Any help would be greatly appreciated.
Pixel
Pixel 2 XL
As per my experience, I observe the pixel 2 xl support drawable and dimension from the following folder
drawable-sw380dp-xhdpi
values-sw380dp-xhdpi
S3 is having resolution 720x1280. I have design for XHDPI (720x1280) and it looks fine in s3 also. but it cuts in nexus 4 (768x1280). same height with respect to s3. but still it goes in scroll.
It might be that nexus 4 is having bottom navigation bar. but what should be the solid solution to make compatible for both the resolution.
should I make the screen height by excluding the bottom navigation height?
The solid solution to make your app compatible for both (or any) resolution is to not make fixed size UI elements. Your controls should have size of wrap_content or match_parent. The content(i.e. bitmap) should be small enough to fit on the smallest supported screen. You should also provide separate layouts/resources for different screen sizes.
I want to design a specific layout for galaxy S3 mini or any device with 4 inch screen size, now I don't want to use normal-layout because what looks perfect in other devices in normal-layout looks messy in 4 inch devices, I tried to do a layout for 480 x 800 like layout-w480dp-h800dp but it didn't work so what specific layout can I use?
Thanks in advance.
i have a question about the app widget in android. I'm a litte bit confused, cause i define in the info xml (res -> xml) the values for width (250) and height (110) (http://developer.android.com/guide/practices/ui_guidelines/widget_design.html). Now i expected my Widget take the in the width 4 cells and in the height 2 cells.
I tested it with a Nexus S (HDPI), all works fine, i tested it with a Nexus 4 (XHDPI), all works fine, i tested it with an Samsung Galaxy Tab 10.1/Emulator tablets (MDPI), it doesn't work, Nexus7 (Emulator) (TVDPI) also it didn't work.
OK, I looked in the Menu and i see the system takes 3 and not 4 cells for the width.
Now my Question is there a way to define specific xml files for the tablets (please notice that i would support device with android 2.3.3) or am I missing something?
Have you tried putting your layout for the widgets into different folders, so that it will be rendered out differently on different screen sizes? For example, when supporting tablets you would have a layout-xlarge folder which contains the layout for your Widget on extra large screens. See here for more information about Tablet layouts.
I am developing a tablet-only app and I put xml files for 10 inch tablets in /res/layout-sw720dp folder.
When I preview customized xml in eclipse, I select device as "10.1in WXGA (Tablet) (1280x800: mdpi) and everything is positioned just fine (note: certain elements need to be positioned by adding some margins (in dp) ... ), but when I run this app on samsung's galaxy tab this elements are not positioned as xml editor shows.
What could be the problem?
Read link 1 and link 2 and you will get idea about how android supports multiple screen sizes.
Better use wrap content or use layout_weight attribute instead of fixing the sizes, for more consistent look on all devices