我使用的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而不改變工具欄的標題? –