1
我试图把两个微调到工具栏(我使用coordinatorlayout)安卓:观点没有出现在工具栏
的代码如下
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
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:theme="@style/AppTheme"
tools:context="com.reports.Dashboard">
<include layout="@layout/content_dashboard"/>
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:elevation="8dp"
android:minHeight="?attr/actionBarSize">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/dashboard_textview_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="1dp"
android:text="Current Month">
</TextView>
<Spinner
android:id="@+id/dashbard_spinner_month"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Spinner
android:id="@+id/dashbard_spinner_year"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
的问题是,当我在检查Android模拟器SDK版本25显示正确,但是当我在物理设备上运行它时,旋转器或TextView不可见。这与支持库版本有关吗?
我还试图运行SDK版本23,但看到相同的行为
我不想在菜单上放置一个菜单..我相信这会把菜单放在操作栏上 – Vivek