首页 > 移动平台 > 详细

Android TV 全屏无标题

时间:2016-07-21 06:21:07      阅读:228      评论:0      收藏:0      [点我收藏+]

想要全部窗口全屏无标题,修改

res\values\styles.xml 可设置主题和样式

<resources>

    <!--
          Base application theme, dependent on API level. This theme is replaced
          by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
      -->
    <style name="AppBaseTheme" parent="android:Theme.Light">
        <!--
            Theme customizations available in newer API levels can go in
            res/values-vXX/styles.xml, while customizations related to
            backward-compatibility can go here.
        -->
    </style>

    <!-- Application theme. -->
    <style name="AppTheme" parent="AppBaseTheme">
        <!-- 设置无标题-->
        <item name="android:windowNoTitle">true</item>
        <!-- 设置全屏-->
        <item name="android:windowFullscreen">true</item>
        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    </style>

</resources>

 

如果要单个窗口设置用如下2个方法

1. 修改AndroidManifest.xml

        <activity android:name=".Convert" 
                  android:label="@string/app_name" 
                  android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > 
            <intent-filter> 
                <action android:name="android.intent.action.MAIN" /> 
                <category android:name="android.intent.category.LAUNCHER" /> 
            </intent-filter> 
        </activity> 

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

 

2. 在代码中设置

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);

 

Android TV 全屏无标题

原文:http://www.cnblogs.com/samvon/p/5690243.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!