小编Ada*_*mar的帖子

Activity类型中的方法setActionBar(工具栏)不适用于参数(工具栏)

这是工具栏布局的XML ...

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mToolbar"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
</android.support.v7.widget.Toolbar>
Run Code Online (Sandbox Code Playgroud)

我正在使用支持库将工具栏用作我的ActionBar.我在onCreate做了这个...

Toolbar mToolbar = (Toolbar)getLayoutInflater().inflate(R.layout.toolbar, null);
setActionBar(mToolbar);
Run Code Online (Sandbox Code Playgroud)

但是,如果给我红色的波浪形,并告诉我标题中的消息.我想,LULWUT?!

android android-actionbar android-toolbar

6
推荐指数
1
解决办法
5801
查看次数