1

I need to programatically change to bring appbar layout at bottom instead of using in xml.

Currently in xml: when I use layout_constraintBottom_toBottomOf in AppBarLayout, it is displaying in bottom. But I need to programatically use this property to bring to bottom.

<com.google.android.material.appbar.AppBarLayout
        android:id="@+id/appbarLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:layout_constraintBottom_toBottomOf="parent">


    <!--<androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?attr/colorPrimary"
            android:minHeight="?attr/actionBarSize"
            android:theme="?attr/actionBarTheme"
            tools:layout_editor_absoluteX="0dp"
            tools:layout_editor_absoluteY="0dp" />-->

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

    </com.google.android.material.appbar.AppBarLayout>
Shadow
  • 6,864
  • 6
  • 44
  • 93
  • 1
    check out [THIS](https://stackoverflow.com/questions/45263159/constraintlayout-change-constraints-programmatically) topic (not only accepted answer) – snachmsm Aug 18 '21 at 08:16

0 Answers0