【问题标题】:React Native + Android TV Eligibility IssueReact Native + Android TV 资格问题
【发布时间】:2022-07-31 18:07:46
【问题描述】:

我正在尝试让我的应用在 Play 商店中用于电视,但谷歌拒绝它声称垂直信箱,但我不知道那是什么,并且在模拟器中所有屏幕都可以正常工作

Error

Screen 1

Screen 2

Screen 3, its a webview

Preload Screen

【问题讨论】:

    标签: android react-native android-tv


    【解决方案1】:

    请检查您的 AndroidManifest.xml 文件。

    1 确保您的所有活动/片段都处于横向模式(如果 明确声明)。

    2 强烈建议使用 Leanback 主题:

    <activity
      android:name="com.example.android.TvActivity"
      android:label="@string/app_name"
      android:theme="@style/Theme.Leanback">
    

    3 您的活动应该有一个 NoTitleBar 主题:

    <activity
        android:name="com.example.android.TvActivity"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar">
    

    4 避免屏幕元素因过扫描和合并 10% 布局的所有边距。这转化为左侧 48dp 的边距 以及基本布局顶部和底部的右边缘和 27dp 边距 活动。以下示例布局演示了如何在 TV 应用的根布局:

    <?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>
    

    【讨论】:

      猜你喜欢
      • 2018-07-20
      • 2019-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-06
      • 2021-03-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多