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我想在标题中显示应用程序名称,但想用微调器代替字幕