Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to center image in toolbar in xamarin forms

$
0
0

Basically I want to center image in the toolbar in my app
I tried to do that manually in android toolbar by modifying native toolbar to

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#536474"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    android:popupTheme="@style/ThemeOverlay.AppCompat.Light"
    >
  <RelativeLayout
      android:layout_width="match_parent"![](https://us.v-cdn.net/5019960/uploads/editor/fq/cv80gfxsaxxq.png "")

      android:layout_height="match_parent">
    <ImageView
        android:id="@id/image"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:paddingTop="5dp"
        android:paddingBottom="5dp"
        android:layout_centerInParent="true"
        android:baselineAlignBottom="true"
        android:scaleType="fitCenter"
        android:src="@drawable/toolbarlogo"
            />
  </RelativeLayout>


</android.support.v7.widget.Toolbar>

But the result is
https://imgur.com/KNjLVgB

and aligned right when navigation to page have a naviagionbar also how to do that in ios ?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>