How to position title to left and logo to right on Android ActionBar? -


i'm new android development, need helping hand. add custom actionbar app. have title displayed on left side, , logo of app on right side. have searched net solutions, reach have title positioned left or logo positioned right, not both displayed. can me how can reach desired display? know google suggest have logo on left side, time need "overwrite" "rule".

try following code custom toolbar

<android.support.v7.widget.toolbar         android:layout_width="match_parent"         android:id="@+id/toolbar"         android:layout_height="?attr/actionbarsize"         android:background="@color/coloraccent"         android:elevation="6dp">           <relativelayout             android:layout_width="match_parent"             android:layout_height="match_parent">                <textview                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:text="tittle here"                 android:textcolor="#ffff"                 android:layout_centerinparent="true"                 android:textsize="23sp"                 android:layout_alignparentleft="true"/>              <imageview                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_alignparentright="true"                 android:src="@mipmap/ic_launcher_round"/>             </relativelayout>      </android.support.v7.widget.toolbar> 

output:

enter image description here

i hope you.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -