问题标签 [android-resolution]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - RadioGroup button images cut off
I have a RadioGroup at the bottom with four buttons acting as a navigation for my application (I know this is non-standard for an Android app, but it's what the client wanted). This is the way it should look:
This looks fine on my Nexus 7, and it looks fine across the Emulators and Previews in my IDE. However, when I load it onto a Galaxy S Note 2, this is how it looks:
The images are cutoff, as it seems they are "shifted" to the right for this particular device. I have a feeling that on smaller devices, it will be even more skewed and cutoff. When I manually do a negative left margin of around 35dp, it actually looks perfect and they align great (but of course that solution doesn't work for other devices).
What's strange is that it doesn't seem that I'm doing anything special in my code, and it's seemingly pretty straight-forward. FYI, even when I change it to just three buttons, it still shifts the buttons to the right, not really centering them (although they aren't cutoff when there are only 3). I just can't figure out why it's doing this, no matter how many things I try out with tweaking gravity, weight, and even swapping out images. I'm currently only using /xhdpi images for these, and the sizes of each are around 130x130 each.
For reference, here is the underlying code for the RadioGroup in my layout file (it's in a RelativeLayout):
And here is the style element for navbar_button:
I may be missing something obvious here, but any thoughts on this? Thanks in advance!
android - Android 应用程序设计分辨率
我需要为android设计一个应用程序。经过一番阅读,我发现android设备在分辨率方面分为几类,比如
- 小屏幕
- 正常画面
- 大屏幕
- 超大屏幕
但密度不同。
所以可以说,现在我需要设计一个普通屏幕,我应该为应用程序 UI的“外观”使用什么分辨率。
从阅读中,我知道 android 应用程序使用 dp 而不是 px。那么,这是否意味着我必须在开始设计之前将几个特定的屏幕尺寸转换为 dp ?
或者我只是简单地针对普通屏幕尺寸(如 320x480)设定一个通用分辨率,前提是我很少有不同密度的可绘制集合?
如果我弄错了,请纠正我。
谢谢
java - 7 英寸 hdpi 平板电脑 Android 的文件夹名称
我有带 hdpi(240 dpi 分类)的 7 英寸屏幕(600×1024)的平板电脑。
我已经创建了文件夹layout-sw600dp
。但它不适用于这款分辨率平板电脑。
它在带有 mdpi(160 dpi 分类)的 7 英寸屏幕(600×1024)上工作正常。
我应该为具有 hdpi(240 dpi 分类)的 7" (600×1024) 平板电脑创建哪个文件夹?
android - 支持不同屏幕尺寸的多个安卓版本
我正在编写一个应用程序,我打算从 Android OS 2.3.3 到最新版本。我必须支持多种屏幕尺寸。
我不明白我可以使用 drawable-hdpi、drawable-mdpi 等提供多种屏幕尺寸支持,但是这些是在 3.2 版中引入的。在 3.2 之前,它类似于 drawable-small、drawable-normal 等。
如果我创建以操作系统版本 2.3.3 为目标设备的应用程序,我应该使用什么样的资源术语?如果我使用 drawable-hdpi 等,它可以在操作系统低于 3.2 的设备上运行吗?
谢谢本森格
android - Nexus 10 的 dimens res 文件夹是什么?
我正在尝试使用我的维度文件中的值来定位 Nexus 10。我将文件夹设置为 values-sw720dp-xhdpi 但这不起作用。我也尝试过 values-sw720dp-xxhdpi 但这仍然不起作用。
我可以在其中存储 Nexus 10 的尺寸值的文件夹的正确实现是什么?
我正在一个完美运行的模拟器上测试这个
android - 具有相同密度、英寸和分辨率的设备的位图大小差异
我有两个平板设备:
1)华硕记事本 172V 平板电脑
在线规格为:600 * 1024 像素,7.0 英寸(~170 ppi 像素密度)链接
通过代码的规格:1024 * 552 像素,7.0 英寸(160 ppi 像素密度)
2) MID 7510 平板电脑
网上给出的规格为:800 * 480 像素,7.0 英寸(任何地方都没有提到密度)链接
通过代码的规格:1024 * 552 像素,7.0 英寸(160 ppi 像素密度)
我的问题是:
-两种平板电脑具有相同的密度和分辨率(通过代码),所以我如何区分它们以设置位图高度(两者的宽度都正确),因为在 的情况下MID7510
,位图高度略微向下延伸。
-是否有任何其他因素导致两个
平板电脑的位图大小不同?
-为什么规格会因代码而异,并且在网上给出的不同?
获取密度和分辨率的代码:
android - Android 应用程序的图像大小
抱歉,我早些时候知道有些人有同样的问题,但我遇到了同样的问题,并且没有从之前的问题中得到清晰的认识。
我发现 Android 对于开发人员来说处理多维度非常复杂。就像有从 ldpi 到 xxhdpi 和平板电脑的设备。
我观察到的图像有不同的文件夹结构,如 ldpi、mdpi、hdpi 和 xhdpi 以及平板电脑 sw-600dp(7inch) 和 sw720dp(10inch)。
现在的问题是有许多手机尺寸为 5 英寸,但分辨率不同,平板电脑的情况也是如此。所以我很困惑,我要求设计师为不同的手机和移动设备制作什么尺寸的图像,因为分辨率因设备而异。
我还检查了链接http://developer.android.com/training/basics/supporting-devices/screens.html 但不清楚。
我是安卓新手。请指导我如何解决这个问题。
android - 为什么我的注册页面与 android 中的所有手机不一样?
我的实际任务是设计一个像这样的注册页面。
https://docs.google.com/file/d/0B_c-SDSO63obTXdXMm4yZmRkUDQ/edit?usp=sharing
我做了一些编码
但是当我在nexus 7中运行时,输出发生了变化。这是https://docs.google.com/file/d/0B_c-SDSO63obT1JGSlBjMHZSbnM/edit?usp=sharing 所以请给出一些建议,我怎样才能完成这项任务以获得与所有手机和平板电脑相同的输出。
我尝试了具有该背景的图像视图+编辑文本。但这也不是正确的。
请给这个任务一些想法。
谢谢你
香卡克莱特
android - Android - Setting for Tablets
I am pretty new to Android. I wanted to know that if i want to design a tablet application then what changes i want make in the existing code which i designed for normal phone.
I did the Research and found,
#xA;and in Manifest
#xA;Is it all done?? or I want to change something other than this??
android - 在 Android 4.+ 上模拟 Galaxy Tab 3
(我在stackoverflow上搜索了很多,但找不到答案)
我的游戏是一款仅限平板电脑的游戏,到目前为止,我的界面适合
- 1024x600 7" 平板电脑 mdpi(例如:HTC Flyer)
- 1280x800 10.1" 平板电脑 mdpi(例如:Acer A500)
- Nexus 7" v2 xhdpi
- Nexus 7" 电视分辨率
我以为我快结束了,但今天我有机会在 Galaxy Tab 3 上快速试用它,主布局上的主图像被拉伸,可能没有使用正确的资源(我希望它使用 mdpi 的)因为它是 7" 1024x600 平板电脑)。我在某处读到 Galaxy 选项卡将使用 hdpi 资源。我做了一些更改,我想对其进行测试,但不幸的是我无法再访问平板电脑。
我安装了三星模拟器,但它以 android 2.2 为目标,所以我无法在其上运行我的应用程序。
然后我尝试通过指定 1024x600、Large 和 HDPI 来创建新定义,但随后游戏会崩溃,因为游戏正在检查启动时的一些值,并且找不到 values-large-hdpi 文件夹。当然我可以创建文件夹/值,但另一方面它并没有在实际的平板电脑上崩溃,所以我不确定这是正确的想法。
那么,如何创建一个类似于 Android 4.+ 上的 Galaxy Tab 3 的 AVD?