本文介绍了requestWindowFeature(Window.FEATURE_NO_TITLE);不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我提到了很多问题....但是在我的情况下没有任何答案.... plz帮助我.....
i have referred many questions....but not any answer working in my case....plz help me.....
package com.example.owner.bikeguard;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
public class LoginActivity extends AppCompatActivity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_login);
}
}
推荐答案
尝试从您的活动中删除应用名称/activitytitlebar
try this to remove the appname/activitytitlebar from your activity
getSupportActionBar().setTitle("");
或在清单文件中像这样使用 android:label ="
or in manifest file use android:label=""
in your like this
<activity android:name=".MainActivity"
android:label="">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
应用此主题以删除style.xml中的整个标题栏
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
或尝试此操作进行全屏活动
or try this for full screen activity
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// remove title
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activitymain);
}
这篇关于requestWindowFeature(Window.FEATURE_NO_TITLE);不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!