3

リサイズビューの上のレイアウトをフレームのように(フレームのように)したいので、そのレイアウトが表示されていてもリサイクルビューの後ろをスクロールすることができます。枠のレイアウトを画面の下部に表示し、必要に応じてそれを目に見えるようにします。ここに私のコードです。ConstraintLayout内のFrameLayoutを一番下に整列する

<?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のようないくつかのプロパティで同じことを達成したい。しかし、いずれのプロパティも使用できません。フレームレイアウトがリサイクルビューの一番下と一番上に同時に表示されるように、私は何をする必要がありますか? ありがとう:)

答えて

2

私は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> 
+1

おかげで:) – Pritish

関連する問題