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