1. 程式人生 > >設定APP全屏無標題

設定APP全屏無標題

1、修改styles.xml檔案

    <style name="AppTheme">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
    </style>

2、修改AndroidManifest.xml下application節點

 <application
        android:name=".app.MeetingApp"
        android:allowBackup="true"
        android:icon="@drawable/app_logo"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
.....

3、修改BaseActivity

public abstract class BaseActivity extends AppCompatActivity

    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //設定標題欄
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        //設定狀態列
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,          
        WindowManager.LayoutParams.FLAG_FULLSCREEN);
        //設定佈局
        setContentView(intiLayout());
        ......