The method to remove the title bar (use requestWindowFeature(window.feature_no_title); Why does it fail?
Use RequestWindowFeature (window.feature_no_title) to hide the cause of the failure of the title bar, possibly because the activity inherits from AppCompatActivity. The use method is described in detail below:
A, if you create the activity inherited activity:
the first one: introduction to often use a method:
requestWindowFeature(Window.FEATURE_NO_TITLE);
//remove the title bar of note that this sentence must be written in the book of the setContentView () method, in front of or complains
the second: in the AndroidManifest. Defined in the XML file
<application android:theme="@android:style/Theme.NoTitleBar">
Wrote, then the application will remove the title bar, if just want to get rid of a certain Activity of the title bar, you can add this property to the Activity inside the tag
the third: this is not commonly used in general application, is in the res/values below to create a new style. The XML file
code is as follows:
duplicate code
<?xml version="1.0" encoding="UTF-8" ?>
<resources>
<style name="notitle">
<item name="android:windowNoTitle">
true
</item>
</style>
</resources>
Copying code
in this way, we can customize a style, is equivalent to a topic, and then in the AndroidManifest. Defined in the XML file, also can achieve the effect of removing the title bar
code is as follows:
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/notitle">
AppCompatActivity>
getSupportActionBar().hide();
//Remove the title bar Note that this sentence must be written after the setContentView() method
Second: You can do the following in AndroidManifest.xml, so there is no title bar
<application
android:theme="@style/Theme.AppCompat.NoActionBar">
Read More:
- [Android] using request window feature( Window.FEATURE_ NO_ Title) method to remove the title invalid solution
- Android set request window feature( Window.FEATURE_ NO_ Title) invalid solution
- Request window feature for Android Development( Window.FEATURE_ NO_ Title) does not take effect
- Error record: this.requestWindowFeature ( Window.FEATURE_ NO_ Title) error or no effect
- Unity “Feature `out variable declaration’ cannot be used because it is not part of the C# 4.0” error
- About creo 4.0 license request failed for feature solution
- Go compiles the EXE executable to remove the CMD window at run time
- TypeError: Failed to execute ‘fetch‘ on ‘Window‘: Request with GET/HEAD method cannot have body.
- When installing mysql, an error occurs when executing the installation command with the CMD window. Install / Remove of the Service denied
- HTML using title attribute to display text with mouse hover
- uin-app dynamically set the title
- Property or field ‘Title‘ cannot be found on object of type
- Opening feature class.General function failure
- error: pathspec ‘feature_card‘ did not match any file(s) known to git
- cannot import name ‘Feature‘ from ‘setuptools‘
- X Error of failed request: BadWindow (invalid Window parameter)
- Packet Title: logs.pcapng
- How to set the custom blood bar UI in UE4 and how to call it
- How to solve the problem that the console window disappears in a flash after visual studio 2017 runs
- Several ways for Ubuntu to open command line terminal window