Android Studio - Action Bar remove
Android studio is open source for mobile application development for IOS and Android. Today i am going to discuss about android Studio how you can remove the action bar from top. Before you start if you are new in android studio you can check this tutorial. how to install android studio in windows machine.
<activity
Android studio is open source for mobile application development for IOS and Android. Today i am going to discuss about android Studio how you can remove the action bar from top. Before you start if you are new in android studio you can check this tutorial. how to install android studio in windows machine.
This lineclass MyActivity : AppCompatActivity() {override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)setContentView(R.layout.my_activity)supportActionBar?.hide()}}
supportActionBar?.hide()
did the job. Start the app, and it works.Though the XML with theme
First, add a new style in the
styles.xml
:<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar"><item name="windowActionBar">false</item><item name="windowNoTitle">true</item></style>Then, open theAndroidManifest.xml
and apply it to the activity you want to hide the action bar. Start the app, and it works.
android:name=".ui.MyActivity"android:theme="@style/AppTheme.NoActionBar"/>