SearchView searchtext = view.findViewById(R.id.search_view);
errorView = view.findViewById(R.id.error_msg_view);
errorTextView = view.findViewById(R.id.error_text_view);
EditText viewById = searchtext.findViewById(android.support.v7.appcompat.R.id.search_src_text);
viewById.setHintTextColor(getResources().getColor(R.color.transparent_White));
viewById.setTextColor(getResources().getColor(R.color.colorWhite));
searchtext.setOnQueryTextListener(this);
ImageView closeBtn = searchtext.findViewById(R.id.search_close_btn);
closeBtn.setImageDrawable(null);
searchtext.setIconified(false);
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:baselineAligned="false"
android:paddingLeft="5dp"
android:paddingRight="5dp">
<FrameLayout
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center">
<Button
android:id="@+id/bt_backButton"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:background="@drawable/ic_arrow_back_white_36dp" />
<Button
android:id="@+id/bt_boneButton"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:background="@drawable/ic_check_white_48dp"
android:visibility="gone" />
</FrameLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="5dp"
android:layout_weight="2">
<android.support.v7.widget.SearchView
android:id="@+id/search_view"
style="@style/Widget.AppCompat.SearchView.ActionBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:queryHint="Search"
app:searchHintIcon="@null">
</android.support.v7.widget.SearchView>
</FrameLayout>
</LinearLayout>