Align FrameLayout inside ConstraintLayout to bottom

I want the layout above the recycler view at the bottom of the screen (for example, a frame), so even when that layout is visible, I can still scroll the recycler view behind it. Therefore, I want to align the frame structure at the bottom of the screen and make it visible and invisible in accordance with the requirements. Here is my code.

 <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
    tools:context="com.protossoft.root.aesencryption.MainActivity">



    <ListView
        android:layout_width="match_parent"
        android:id="@+id/listView"
        android:layout_height="match_parent">

    </ListView>

  <!--  <RelativeLayout
        android:layout_width="match_parent"

        android:layout_height="wrap_content">-->
    <FrameLayout
        android:layout_width="match_parent"

        android:layout_height="wrap_content"
        tools:layout_editor_absoluteX="0dp"
        tools:layout_editor_absoluteY="443dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="10dp"
            android:gravity="center"
            android:orientation="horizontal">

            <ImageView
                android:id="@+id/deviceNumberImage"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="0.2"
                android:src="@android:drawable/btn_default" />

            <TextView
                android:id="@+id/deviceNumber"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="0.8"
                android:text="990000862471854" />

        </LinearLayout>
    </FrameLayout>
   <!-- </RelativeLayout>-->

I donโ€™t know much about the layout of constraints, but when I move the view to the bottom of the editor, it uses a property like

tools:layout_editor_absoluteX="0dp"
    tools:layout_editor_absoluteY="443dp"

I want to achieve the same with some property like align_parentBottom. But none of the properties are available for use. What do I need to do to make the frame layout visible at the bottom and top of the recycler view simultaneously? Thank:)

+4
1

, align_parentBottom.

app:layout_constraintEnd_toEndOf="parent".

, :

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <FrameLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent">
        ...
    </FrameLayout>

</android.support.constraint.ConstraintLayout>
+4

Source: https://habr.com/ru/post/1690258/


All Articles