android - FrameLayout width is not equal to its parent which is a Toolbar -
i have framelayout inside toolbar problem set framelayout width match patent not going equal wherease toolbar full length code follows
<android.support.design.widget.coordinatorlayout 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:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:context="com.ecbclass.user_activity.home"> <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/apptheme.appbaroverlay"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="?attr/colorprimary" app:popuptheme="@style/apptheme.popupoverlay"> <framelayout android:layout_width="match_parent" android:layout_height="match_parent"> <textview android:id="@+id/app_title_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="ecb class" android:textappearance="?android:attr/textappearancelarge" android:textcolor="#fff" android:textstyle="bold" /> <android.support.v7.widget.searchview android:id="@+id/search_view" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:elevation="5dp" android:hapticfeedbackenabled="true" android:layoutdirection="rtl"> </android.support.v7.widget.searchview> </framelayout> </android.support.v7.widget.toolbar> </android.support.design.widget.appbarlayout> <include layout="@layout/content_home" />
please suggest me way solve problem
add few lines (contentinsetleft
, contentinsetstart
) toolbar
, you're done:-
<android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="?attr/colorprimary" app:popuptheme="@style/apptheme.popupoverlay" android:contentinsetleft="0dp" android:contentinsetstart="0dp" app:contentinsetleft="0dp" app:contentinsetstart="0dp" />
Comments
Post a Comment