Android TV上的超额保证金

时间:2015-01-08 09:07:20

标签: android android-layout android-5.0-lollipop android-tv

我正在使用ADT-1开发者套件修改现有应用程序以在Android TV上运行 在Android TV上安装时原始应用程序布局的外边缘被剪裁 然后我跟着this link并为布局的根设置了过扫描。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/base_layout"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:layout_marginTop="27dp"
  android:layout_marginLeft="48dp"
  android:layout_marginRight="48dp"
  android:layout_marginBottom="27dp" >
  .....
</LinearLayout>

但结果如下。 布局的根部是边缘,它不会填满屏幕(红色矩形区域) 根布局的过扫描边距的像素是什么来填充屏幕?提前致谢。 enter image description here

2 个答案:

答案 0 :(得分:1)

没有正确的保证金,因为它取决于您的电视

有些电视将放大图片(例如,那些具有非标准宽高比的电视),以便它适合屏幕,其他一些电视将保留图片< / em>的

因此,您的布局会增加10%的保证金,以确保始终可见。使用px代替dp几乎没有差别。

答案 1 :(得分:0)

如果电视没有在系统设置中提供过扫描设置(就像我的sony android TV一样),你可以通过shell修复它:

adb shell wm overscan 0,0,0,0
adb shell wm overscan 10,20,30,40

如果重置不符合预期,请使用LEFT,TOP,RIGHT,BOTTOM值(以像素为单位)

{{1}}