码迷,mamicode.com
首页 > 移动开发 > 详细

Android TV 全屏无标题

时间:2016-07-21 06:23:04      阅读:224      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!