简体   繁体   English

AndroidApp:不使用全屏分辨率

[英]AndroidApp: not using the full screen resolution

I tried to test Android-programming on my phone and not the emulator. 我试图在手机而不是模拟器上测试Android编程。 There the apps only use some little space in center of the screen. 应用程序只在屏幕中央使用一些小空间。 In the emulator everything works fine. 在模拟器中一切正常。 So I also tried the 'Hello world'-app. 所以我也试过'Hello world'应用程序。 But there is the same problem. 但是存在同样的问题。 The phone is an HTD HD2 with HyperDroid. 这款手机是带有HyperDroid的HTD HD2。 So it has changed density to 167. When using width and height from onSizeChanged it says 320x430 or 480x270. 因此它将密度更改为167.当使用onSizeChanged的宽度和高度时,它表示320x430或480x270。

Is there a way to use the whole screen? 有没有办法使用整个屏幕?

EDIT 1: 编辑1:

It also uses less screen on emulator with changed density. 它还在模拟器上使用较少的屏幕,密度更改。 This also means that the titlebar doesn't use the whole width. 这也意味着标题栏不使用整个宽度。 Here is a screenshot of the emulator: klick 以下是模拟器的屏幕截图: klick

if you want to apply this for full application then 如果你想将它应用于完整的应用程序那么

Add this line to Application tab 将此行添加到应用程序选项卡

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

otherwise if you want for individual activities then 否则,如果你想要个人活动那么

Add this line to "Activity tab properties" 将此行添加到“活动选项卡属性”

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

Make sure you have put the 确保你已经把

<uses-sdk android:minSdkVersion="xx" android:targetSdkVersion="xx"/>

tag in your manifest file. 清单文件中的标记。 This solved this issue for me. 这为我解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM