我希望在屏幕底部以上的可滚动视图中添加一个布局(如框架),即使该布局可见,我也仍然可以在其后滚动可滚动视图。因此,我想将框架布局与屏幕底部对齐,并根据需要设置其可见性。以下是我的代码。
<?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>-->
我对约束布局并不是很了解,但当我从编辑器中移动底部视图时,它使用类似于
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="443dp"
我希望使用类似于align_parentBottom的属性来实现相同的效果。但是没有任何可用的属性可以使用。我需要做什么才能使框架布局同时可见于recycler view的顶部和底部呢?谢谢 :)