Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何将微调器添加到工具栏字幕_Android_Spinner_Toolbar_Custom Adapter - Fatal编程技术网

Android 如何将微调器添加到工具栏字幕

Android 如何将微调器添加到工具栏字幕,android,spinner,toolbar,custom-adapter,Android,Spinner,Toolbar,Custom Adapter,我已经实现了使用自定义适配器将微调器添加到工具栏的代码 但现在我需要在工具栏的副标题中添加相同的微调器,这里我需要您的帮助您可以吗? toolbar.xml- <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schem

我已经实现了使用自定义适配器将微调器添加到工具栏的代码

但现在我需要在工具栏的副标题中添加相同的
微调器,这里我需要您的帮助您可以吗?

toolbar.xml-

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/colorPrimaryDark"
    android:minHeight="?attr/actionBarSize"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
     >

    <Spinner
        android:id="@+id/spinner_nav"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</android.support.v7.widget.Toolbar>

检查此项

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/colorPrimaryDark"
    android:minHeight="?attr/actionBarSize"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
     >

   <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">


    <TextView
        android:id="@+id/tv_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
   <Spinner
        android:id="@+id/spinner_nav_sub"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>

</android.support.v7.widget.Toolbar>

检查此项

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/colorPrimaryDark"
    android:minHeight="?attr/actionBarSize"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
     >

   <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">


    <TextView
        android:id="@+id/tv_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
   <Spinner
        android:id="@+id/spinner_nav_sub"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>

</android.support.v7.widget.Toolbar>


我可以知道原因吗??DOWNVOTEIn发布的图片您已经在工具栏的副标题中添加了一个微调器。那么问题是什么呢?答案很简单,拿
LinearLayout
insdie放两个微调器@ρ∑ρρєK我想在标题中显示应用程序名称,但想用微调器代替字幕我可以知道原因吗??DOWNVOTEIn发布的图片您已经在工具栏的副标题中添加了一个微调器。那么问题是什么呢?答案很简单,取
LinearLayout
insdie,放置两个微调器@ρ∑ρѕρєK我想在标题中显示应用程序名称,但想用微调器代替字幕