screen-size

iOS get physical screen size programmatically?

不羁的心 提交于 2019-11-27 14:21:04
问题 Is this possible? I want the number of inches, not the number of pixels. I know it is approximately 160 ppi. But not exactly. 回答1: If it were available it would be in UIScreen or UIDevice but it is not there. You can infer it from info in Erica's UIDevice-extension and the specs for each device listed here on Wikipedia. 回答2: There isn't an API that will give you this. Your best bet is to look at the device's screen size (in points) and from that surmise if it's an iPad or iPhone etc., and

Android Screen sizes

半城伤御伤魂 提交于 2019-11-27 12:26:20
I need to know the screen sizes of android devices to support multiple screen sizes application. I don't think there's a comprehensive list of all existing screen sizes, since new devices are coming out all the time. Have you seen the page on Screen Sizes and Densities and the documentation on Supporting Multiple Screens ? Look at this table: http://developer.android.com/guide/practices/screens_support.html#testing You can use the pie chart here to have an idea of relative screen size usage: http://developer.android.com/resources/dashboard/screens.html For a list of screen sizes, resolutions

Most popular screen sizes/resolutions on Android phones [closed]

百般思念 提交于 2019-11-27 08:55:54
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . I understand that Android's developer site provides information on this topic. I have already read the following three pages: Supporting Multiple Screens Screen Sizes and Densites Icon Design Guidelines They do not give the information/statistics that I am looking for.

Can’t use android:xlargeScreens=“true”?

£可爱£侵袭症+ 提交于 2019-11-27 07:36:45
问题 I am making app for phones, but I wan’t them to be usable on tablets. I don’t know why can’t. I use this in my android manifest file: android:xlargeScreens="true" I get this error: error: No resource identifier found for attribute 'xlargeScreens' in package 'android' This is my manifest file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="cro.perger.bonbon" android:versionCode="5" android:versionName="1.4"> <uses-sdk

Difference between “screen size” and “screen density” in Android?

喜夏-厌秋 提交于 2019-11-27 04:15:49
问题 I have a few questions: What is the screen size ? What is the screen density ? What is a difference between screen size and screen density ? How I can support different densities and different screen sizes in Android? I have already read the official documentation, but I was unable to understand the difference between screen size and screen density . 回答1: Screen density means how many pixels appear within a constant area of the display, dots per inch = dpi Screen size means amount of physical

Android Changing image size depending on Screen Size?

我的梦境 提交于 2019-11-27 03:28:44
问题 So I need to change the size of an image depending on the area of the screen. The image will have to be half of the screen height, because otherwise it overlaps some text. So Height= 1/2 Screen Height. Width = Height*Aspect Ratio (Just trying to keep the aspect ratio the same) I found something that was: Display myDisplay = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); int width =myDisplay.getWidth(); int height=myDisplay.getHeight(); But how would I change

support for different screen sizes in android

大憨熊 提交于 2019-11-26 18:40:37
问题 i want to my apps support different screen sizes. i add folders "layout-small and layout-large " in /res directory. but XMLs inside this folders aren't accessible in my activity.so i add all my XMLs in default layout and add this code if((getResources().getConfiguration().screenLayout && Configuration.SCREENLAYOUT_SIZE_SMALL) == Configuration.SCREENLAYOUT_SIZE_SMALL) { setContentView(R.layout.main1); }else if((getResources().getConfiguration().screenLayout && Configuration.SCREENLAYOUT_SIZE

Text size and different android screen sizes

末鹿安然 提交于 2019-11-26 00:31:29
问题 I know, it was discussed already 1000 times, but I can\'t adjust the text size for different screen sizes. I try to use \'sp\' as size units in my custom style: <style name=\"CustumButtonStyle\" parent=\"@android:style/Widget.Button\"> ... <item name=\"android:textSize\">30sp</item> ... </style> In 2.7 QVGA it looks OK: But in 7in WSVGA it looks like this: I\'ve tried to use both \'sp\' and \'dp\' with the same result. Could you please explain how to make these buttons look the same on any