public class ActivityT extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_activity_t);
}
}
布局
<?xml version=”1.0″ encoding=”utf-8″?>
<LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”
xmlns:tools=”http://schemas.android.com/tools”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:orientation=”vertical”>
<android.support.v7.widget.Toolbar
android:id=”@+id/toolbar”
android:background=”#ff0000″
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:minHeight=”?attr/actionBarSize”
>
</android.support.v7.widget.Toolbar>
</LinearLayout>
value/styles里的设置
<style name=”AppTheme.NoActionBar”>
<item name=”windowActionBar”>false</item>
<item name=”windowNoTitle”>true</item>
</style>
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_activity_t);
}
}
布局
<?xml version=”1.0″ encoding=”utf-8″?>
<LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”
xmlns:tools=”http://schemas.android.com/tools”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:orientation=”vertical”>
<android.support.v7.widget.Toolbar
android:id=”@+id/toolbar”
android:background=”#ff0000″
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:minHeight=”?attr/actionBarSize”
>
</android.support.v7.widget.Toolbar>
</LinearLayout>
value/styles里的设置
<style name=”AppTheme.NoActionBar”>
<item name=”windowActionBar”>false</item>
<item name=”windowNoTitle”>true</item>
</style>
解决方案
10
可以呀,设置无标题栏
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
10
在setContentView(R.layout.activity_activity_t);的上面写requestWindowFeature(Window.FEATURE_NO_TITLE);就可以去掉