I used to use Eclipse to write APP, but today I try to use Android Sutido to write APP. I need to hide the title bar in the APP and use a custom title bar. It turns out that using requestWindowFeature(window.feature_no_title) method has no effect, and the title is not hidden
public class TitlebarActivity extends AppCompatActivity
In Android Studio, activities inherit from AppCompatActivity by default, so the requestWindowFeature(window.feature_no_title) method fails.
There are two solutions
- > change AppCompatActivity to Activity, then requestWindowFeature(window.feature_no_title); Add the following code to the onCreate() method:
if (getSupportActionBar() != null){
getSupportActionBar().hide();
}
Now you can hide the title bar.
Read More:
- How to remove the title bar (using the request window feature)( Window.FEATURE_ NO_ Title); why it fails)
- 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
- About creo 4.0 license request failed for feature solution
- TypeError: Failed to execute ‘fetch‘ on ‘Window‘: Request with GET/HEAD method cannot have body.
- X Error of failed request: BadWindow (invalid Window parameter)
- Go compiles the EXE executable to remove the CMD window at run time
- 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
- Idea pop-up window out of memory, modify the parameters and start the no response solution
- Solution to the flash of visual studio console program output window
- Property or field ‘Title‘ cannot be found on object of type
- uin-app dynamically set the title
- Opening feature class.General function failure
- cannot import name ‘Feature‘ from ‘setuptools‘
- error: pathspec ‘feature_card‘ did not match any file(s) known to git
- VS2010 debugging window flash solution
- Packet Title: logs.pcapng
- Solution of OpenGL window flicker in MFC framework