这是我的xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:showIn="@layout/activity_test">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:padding="@dimen/dp5"
app:layout_constraintBottom_toTopOf="@+id/tiLayout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:background="@drawable/shape_oval_profile"
android:contentDescription="@string/add"
android:padding="10dp"
android:src="@drawable/ic_outline_info_24px"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/tiLayout"
app:layout_constraintStart_toStartOf="parent" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tiLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/enter_the_message"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/imageView">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/tiEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="9"
android:fontFamily="@font/trebuchet"
android:inputType="textMultiLine"
android:textColor="@color/grey" />
</com.google.android.material.textfield.TextInputLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
这给了我以下输出,
如果将TextInputLayout
的宽度更改为android:layout_width="wrap_content"
,我将得到以下输出
答案 0 :(得分:0)
尝试在TextInputLayout中添加app:layout_constraintTop_toTopOf="@+id/imageView"
和app:layout_constraintBottom_toBottomOf="@+id/imageView"
约束。保持版面高度为wrap_content
。
答案 1 :(得分:0)
您必须从
n / 2
中删除dfsa2(n) => n % 2 == 0 ? n / 2 + sa(n / 2, 2) : sa(n, 2) - sa(n / 2, 2) - n / 2; dfsa5(n) => n % 2 == 0 ? sa(n / 2, 5) : sa(n, 5) - sa(n / 2, 5);
。
app:layout_constraintEnd_toStartOf="@+id/tiLayout"