我使用的TextView工具栏上的TextView的行动,我想设置正确的这个TextView的与搜索查看留如何使用工具栏上的
我的XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:anroid="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar_search_result"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:titleTextColor="@android:color/holo_blue_bright" >
<TextView
anroid:id="@+id/toolbarTextView"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:visibility="gone"
android:text="FILTER"
android:textColor="@color/whiteColor" />
</android.support.v7.widget.Toolbar>
<TextView
android:id="@+id/text_view_result"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="test result" />
</LinearLayout>
当我建,TextView的没有出现在ToolBar的右侧,它只是出现在SearchView的EditText中。
如何解决这个问题?谢谢
为什么要添加textview而不改变工具栏的标题? –